Welcome Guest, Not a member yet? Register   Sign In
Using Session ID to delete abandoned carts
#1

[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.
#2

[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.
#3

[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.
#4

[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?




Theme © iAndrew 2016 - Forum software by © MyBB