perl cookies wrong time -


so creating cookies using perl's cgi module, , so:

my $cookie = cgi::cookie->new(-name    =>  "$name",                          -value   =>  "$val",                          -expires =>  "$expiration_date",                          -path    =>  $cookie_path,                          -secure  =>  0                         );  print "set-cookie: $cookie\n"; 

and cookie set in browser, issue time not match expiration date put. example, if put +1d expiration date, +1d - several hours. checked system time see if issue, system time right. printed out cookie , got this:

actual time of cookie creation: 6/4/2012 12:10:02 pm     cookie: session_id=534fec49c864d8cf0325779b0921b6be1338829802484; path=/; expires=tue, 05-jun-2012 17:10:02 gmt 

the strage thing above record actual time of cookie creation perl's 'localtime(time())' function, records different time date command puts out (so not actual current time)! , expiration time on cookie correct, it's in wrong time zone.

so server in eastern timezone when run date command:

mon jun  4 12:05:12 est 2012 

however, cookie being set gmt timezone, , think issue. there time should setting on server besides date? i'm running on centos 5 if helps @ all. thanks!

those times equivalent (12:00 est 17:00 gmt). note cookies required, specification, specify expiry time in gmt. browser, in turn, required automatically convert time zone back.

in many words: happening should.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -