|
Posted by lawpoop on 01/02/08 17:05
Hello all -
Is there a way to get the local time from the user's browser? I didn't
see anything in the $_SERVER array.
For unsetting cookies, the PHP documentation page for cookies
recommends setting the expiration date to a point in the past.
However, I'm running into problems with time conflicts. Our server is
in a different time zone than the browser I'm developing on. I would
like to go in five-minute increments to test my code after the cookie
expires, and it took me forever to figure out why my cookies weren't
expiring in five minutes.
It's not a big deal because it's only a few hours, so I can set the
time back several hours when we actually go into production. Of
course, hard coding any time could fail, is the user is halfway around
the world. So ideally I could look at the browser's local time, and
set the cookie back appropriately.
[Back to original message]
|