CodeIgniter Forums
Sessions not working with time_reference set to gmt - 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 not working with time_reference set to gmt (/showthread.php?tid=19491)



Sessions not working with time_reference set to gmt - El Forum - 06-09-2009

[eluser]Dan Horrigan[/eluser]
Anyone else have this issue? If I set this:
Code:
$config['time_reference'] = 'gmt'

Then my cookies seem to be expiring instantly. Any data I put in them is gone when I try to access them on the next page.

On an odd note, flashdata works perfectly fine.

Any help would be great.


Sessions not working with time_reference set to gmt - El Forum - 06-09-2009

[eluser]TheFuzzy0ne[/eluser]
I'd recommend you clear all cache and cookies pertaining to your site, and try again.


Sessions not working with time_reference set to gmt - El Forum - 06-09-2009

[eluser]Dan Horrigan[/eluser]
I have done this. It seems to be an issue with CI setting the expiration date of the cookie using gmt, but my pc is in GMT -4. But my thinking is that should make the cookie valid longer...not shorter. This has been verified as an issue on multiple computers.


Sessions not working with time_reference set to gmt - El Forum - 06-09-2009

[eluser]Dam1an[/eluser]
Do they expire immediatly if you have the timezone of any other negative or is it just GMT?


Sessions not working with time_reference set to gmt - El Forum - 06-09-2009

[eluser]TheFuzzy0ne[/eluser]
Have you set your system's timezone correctly? You can do this by double-clicking the time at the bottom right hand side of your screen, and then selecting the "Time Zone" tab.


Sessions not working with time_reference set to gmt - El Forum - 06-09-2009

[eluser]Dan Horrigan[/eluser]
Thanks for your help guys, but I am going to simply set time_reference back to 'local' and then use local_to_gmt() when needed.