website Favorites (without logging in)

By concrete - March 17, 2010

Is there a way to modify the favorites plugin, so that a user does not have to log in to add it to the database. Instead of a user id I would like to use a session id.

In summary.

If the user is logged in, it should work like normal. If the user is not logged in the script uses a session ID.

Re: [concrete] website Favorites (without logging in)

By Dave - March 17, 2010

Hi concrete,

There's no easy way to do that, and you'd have issues such as the user losing all their favorites when their session expired (or they closed their browser, etc), multiple session ids would also fill up the database.

If you wanted to do it like that, the simplest might be to just store the favorites in the users session directly, since the stored data is only good as long as the session itself.

If you did that, though, for consistency you'd probably want to copy those over to the database when they signed-in or registered though.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com