I’d like to know if there is any way to create session data that expires earlier than default session expire time in codeigniter?
For example, storing shopping cart indefinitely but everything else expires after 30 minutes.
Do I have to do it the hard way (deleting them manually)?
Thanks.
My opinion is that you have to use things the way they are designed. Sessions are meant to be a temporary storage as the user switches pages. If you want to store something indefinitely, store it in a database. Thats what databases are designed fore.
To identify the user, and his shopping card, you have to store a cookie with a ID on the users machine, or let the user login or register.
By using a database, and a login mechanism, the user can retrieve his shopping card also on an other location on a different machine.
Let the user delete his own shopping card, and use a cleanup mechanism for shopping cards older then a certain time (3 months, a year?)