![]() |
Session gets destroyed - 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: Session gets destroyed (/showthread.php?tid=19758) |
Session gets destroyed - El Forum - 06-18-2009 [eluser]himself[/eluser] Hi My sessions keeps getting destroyed, e.g the user gets logged out. I simply cannot figure out why. Mysql data (which prob gets messed up now): Code: SELECT session_id, last_activity, length(user_data) FROM ci_sessions; Th ip and user agent is not the problem, and the above should show that the cookie size (4kb) is not the problem. My "ci-session-refresh-interval" is set at 300, so looking at the timestamp, it seems that it fails on the first attempt. Normally the session works just fine, but not in this scenario: I have a long list of images to be processed, there is not enough memory to process them all in one go, so i've made a form that, through javascript, submits itself, processes an image, submits itself, .... until its done. From the sqldump you can se that it creates a new session_id. From tampering a bit with the Session library, i can see that it's the session_id that (at some point) gets changed, so the session library creates a new on, meaning.. the user gets logged out. Can anyone help point out where the problem could be, I know its a bit vague, but, hey... shoot :-) Sincerely, Jonas Session gets destroyed - El Forum - 06-18-2009 [eluser]gtech[/eluser] The sessionid is supposed to get regenerated after every 5 minutes (or 300 seconds), this is a security measure to make session hijacking more difficult. But I dont understand why that would log your user out? the session data is still there and you can still retrieve it, as a copy is made when the new id is generated. Code: // session data can still be retrieved after the sess_id has changed maybee the session is expiring?, see sess_expiration in the config. this would cause the session to be destroyed. Session gets destroyed - El Forum - 06-18-2009 [eluser]TheFuzzy0ne[/eluser] You don't have to process all of your images at the same time. You can just loop through each of them, reading them from the hard drive. Is this just a random thing, or does it only happen when you run a certain controller, or a certain condition is met? What are the contents of the cookie? Is it encrypted? Do you still get the problem when you disable database sessions? |