![]() |
Losing Session Data - 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: Losing Session Data (/showthread.php?tid=32604) |
Losing Session Data - El Forum - 07-28-2010 [eluser]derekmichaeljohnson[/eluser] I have a 2 page registration process, and the data from the first page is stored in an array in the user's session data. To give you an example: Code: $pg1 = array( Then once they complete the second page, the data is merged with the first page and is processed. All was well, until someone reported an error which was being caused by the data from the first page NOT being present at the time of processing. The details are sketchy, so I can't be certain how long they waited between pages, but I'm going to assume the session data expired. Could this have something to do with CI refreshing the session information (set to 300 seconds)? The user definitely did NOT wait 2 hours to finish the second page, which is the time set for sessions to expire (in config.php). Any ideas? Losing Session Data - El Forum - 07-28-2010 [eluser]treeface[/eluser] Hm, not sure...perhaps the user has cookies disabled? <b>edit:</b> Also...have you tried using flashdata? I don't think it should matter, but who knows.. Losing Session Data - El Forum - 07-28-2010 [eluser]derekmichaeljohnson[/eluser] [quote author="treeface" date="1280356560"]Hm, not sure...perhaps the user has cookies disabled?[/quote] Unfortunately, no. That was my first guess, too :-) Losing Session Data - El Forum - 07-28-2010 [eluser]mi6crazyheart[/eluser] Can u show u'r codes... Losing Session Data - El Forum - 07-28-2010 [eluser]treeface[/eluser] Aw damn. Has the user been able to replicate the issue? Have any other users reported it? Is this something you've ever noticed before? Losing Session Data - El Forum - 07-28-2010 [eluser]derekmichaeljohnson[/eluser] [quote author="mi6crazyheart" date="1280357334"]Can u show u'r codes...[/quote] Sure. Code: function add() Nope, the user has not experienced it since, and no others have reported problems. Losing Session Data - El Forum - 07-28-2010 [eluser]treeface[/eluser] [quote author="derekmichaeljohnson" date="1280357936"]Nope, the user has not experienced it since, and no others have reported problems.[/quote] Well then harumph, I say. Maybe it was just a glitch in the Matrix. If I were you, I'd keep note of it and wait for it to happen again. I don't immediately see anything wrong with your code. Losing Session Data - El Forum - 07-28-2010 [eluser]derekmichaeljohnson[/eluser] [quote author="treeface" date="1280358610"]Well then harumph, I say.[/quote] Give the governor a HARUMPH! I'll keep watching it and see what happens. In the meantime, anyone else see any problems? Losing Session Data - El Forum - 07-29-2010 [eluser]loosetops[/eluser] I have lost a session variable recently and I couldn't figure out why. Out of about 7 session variables one disappeared. I'm still waiting for it to happen again while still in development. Losing Session Data - El Forum - 07-29-2010 [eluser]LuckyFella73[/eluser] In case you didn't check: be sure that the sess_cookie_name and cookie_prefix (defined in config.php) have NO underscore (IE issue) and set the cookie domain like commented in config.php - i.e. ".yourdomain.com" I read many posts about lost sessions and in most cases the source of the problem was one of this config lines. Hope that helps. |