![]() |
Sessions disappearing? - 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: Sessions disappearing? (/showthread.php?tid=40554) |
Sessions disappearing? - El Forum - 04-12-2011 [eluser]@li[/eluser] Hi, I'm using the CodeIgniter session library, storing the sessions to the database. I have a strange problem, whenever I set a session and redirect a user, using: Code: $this->session->set_userdata('foo', 'bar'); I'm able to access this variable just fine the first time around, but if I do a page refresh this session value is gone.. what's the reason behind this? Edit: It seems that in config.php, changing this: Code: $config['sess_expiration'] = 7200; Code: $config['sess_expiration'] = 0; fixes this issue, even though if the variable is set to 7200, that should mean that the session would be active for 7200 seconds (i.e 2 hours) while it actually disappears with each page load. Sessions disappearing? - El Forum - 04-12-2011 [eluser]InsiteFX[/eluser] There could be a number of things that are causing this. 1) Your server time could be off, check your server time! 2) Your browser is not setup for all cookies, check your browser cookie settings. 3) If your running IE then you need to change the cookie name from ci_session to cisession InsiteFX Sessions disappearing? - El Forum - 04-12-2011 [eluser]@li[/eluser] I'm using chrome and this is on my dev machine with windows XP, the time is correct and cookies are enabled. Does the cookie name have to be changed with chrome? Sessions disappearing? - El Forum - 04-13-2011 [eluser]WanWizard[/eluser] No, but it needs to be configured in accordance with the RFC. Chrome is getting stricter by the minute, and rejects all cookies that are not compliant. This means for example that you can't use 'localhost' as cookie domain, as it is illegal per the RFC. Sessions disappearing? - El Forum - 05-10-2011 [eluser]Ninjabear[/eluser] [quote author="@li" date="1302672382"]I'm using chrome and this is on my dev machine with windows XP, the time is correct and cookies are enabled. Does the cookie name have to be changed with chrome?[/quote] Did you ever get this one sorted out @li? Sessions disappearing? - El Forum - 05-10-2011 [eluser]cideveloper[/eluser] [quote author="Ninjabear" date="1305053923"][quote author="@li" date="1302672382"]I'm using chrome and this is on my dev machine with windows XP, the time is correct and cookies are enabled. Does the cookie name have to be changed with chrome?[/quote] Did you ever get this one sorted out @li?[/quote] I really wish people would close out their threads if they have figured out their problems. Also if they do get an answer they like they should say so. That way people would know if an answer given was correct and helped. Why do you ask, Ninjabear? Sessions disappearing? - El Forum - 05-10-2011 [eluser]InsiteFX[/eluser] Add [SOLVED] in Post Title InsiteFX Sessions disappearing? - El Forum - 05-10-2011 [eluser]Ninjabear[/eluser] [quote author="InsiteFX" date="1305072110"]Add [SOLVED] in Post Title InsiteFX[/quote] Doh |