![]() |
Using Session ID to delete abandoned carts - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Using Session ID to delete abandoned carts (/showthread.php?tid=21376) |
Using Session ID to delete abandoned carts - El Forum - 08-07-2009 [eluser]Henry Weismann[/eluser] Hey I have a checkout procedure and want to delete abandoned carts based on the last activity of the session. If I save the session id in a pending orders table will I be able to delete pending orders based on the last activity in the ci_sessions table or if the session id no longer exists? I wasn't sure if the session id changes for session hijacking reasons that's why I am asking. PS: I am using the new cart library and its great. I think it could use a way to add line items independent of cart items...like shipping, tax, whatever. Although it might be intended for the programmer to add that piece. Using Session ID to delete abandoned carts - El Forum - 08-07-2009 [eluser]Cro_Crx[/eluser] Well what is your sess_expiration value set to? I'm fairly sure the session is destroyed after that value. You could test this by setting it to something quite low and then using print_r($this->session->userdata) to view all the session variables and check to see if the ID changes or not. The sessions are refreshed on the 'sess_time_to_update' interval, but i dont' think it gives you a new session ID, i could be wrong however. Using Session ID to delete abandoned carts - El Forum - 08-08-2009 [eluser]Henry Weismann[/eluser] Thanks Cro_Crx...yeah the session being destroyed when the time limit is up is fine. I just wanted to make sure the session id is not changed during the users visit. I'm pretty sure it is not changed but I figured I would double check. Using Session ID to delete abandoned carts - El Forum - 08-08-2009 [eluser]Henry Weismann[/eluser] Ok I re-read the user guide and found this...so I guess it does change: Quote:If a session does exist, its information will be updated and the cookie will be updated. With each update, the session_id will be regenerated. Is there a better way to determine when the non logged in website user is no longer active? |