CodeIgniter Forums
Can you store recommandations 'tags' in a session? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Can you store recommandations 'tags' in a session? (/showthread.php?tid=34744)



Can you store recommandations 'tags' in a session? - El Forum - 10-08-2010

[eluser]Christophe28[/eluser]
Hi,

I use encrypted cookies and the userdata of the session is stored in the database.

You know these recommandations on Amazon? When you have searched for a good JavaScript book and you visit Amazon next day there are all kind of JavaScript books as recommandations on the homepage.

I want to build something like that. I was thinking of storing the tags of pages users has visit and search queries in a column in the users table. But what to do with users who are not logged in? Can you store these tags in the session database? Something tells me this isn't the best solution ... Or maybe create a whole new table in the db, and store tags by IP address?

Has anyone experience with this, or a good solution for me?

Christophe


Can you store recommandations 'tags' in a session? - El Forum - 10-08-2010

[eluser]Dennis Rasmussen[/eluser]
Cookie for non-users and database with more data for users.
Or just cookies with simple data for both.


Can you store recommandations 'tags' in a session? - El Forum - 10-08-2010

[eluser]Christophe28[/eluser]
Thx!

I think I'll store the non-user 'tags' in the session table and the tags of the users in a column in the 'users' table, just like you meant I think.

Christophe


Can you store recommandations 'tags' in a session? - El Forum - 10-08-2010

[eluser]bretticus[/eluser]
You could optionally store a cookie for 30/60/90 days that has some unique token that references associated tags in the database. That way you have persistence and you can link up user accounts with the token data later if you want increased persistence. Anonymous users will remain anonymous but you will be able to profile them (this is probably similar to what Amazon is doing I'd assume.)


Can you store recommandations 'tags' in a session? - El Forum - 10-08-2010

[eluser]Christophe28[/eluser]
That's not a bad idea actually! I'll give it a look. Thanks!