Re: deleting cookies and local browser time versus server time
- From: Good Man <heyho@xxxxxxxxxx>
- Date: Wed, 02 Jan 2008 16:34:14 -0600
lawpoop@xxxxxxxxx wrote in
news:43ae8e36-b358-4a34-9b2f-699797bb0bba@xxxxxxxxxxxxxxxxxxxxxxxxxxx:
Several others are listed in this page:
http://us.php.net/reserved.variables
Yep, my bad. I guess I just tend to ignore any 'browser' information in
my apps.
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.
Don't involve the user local time at all. Put the server time in a
variable, and test THAT number in 5 minute increments.
How can I test cookie expiration with that? The browser unsets cookies
based on what *it* thinks the time is, not what the server thinks the
time is.
In other words, if the server is in Pacific time, and I'm in Eastern
time, setting the cookie to expire on date() ( meaning, 'right now' )
looks to be 3 or 4 hours in the past to my browser. So, if the server
give a cookie to expire at 4PM today, which is the time in Seattle,
that expiration date is already in the past for me, since it's already
7PM.
I guess I'm having a bit of difficulty trying to understand. Cookies
are local/stored on the user browser, correct? So with you in Los
Angeles and I in New York, we'll never see each others' cookies.
I interpreted your problem as essentially keeping a file 'open' or
'checked out' (insert your verb here) for 5 minutes before
allowing/disallowing changes or something. So, if you open a file at
10amPST, and I want to open it a minute later (1pm EST), I should see
that only 1 minute has passed (as opposed to 3 hours and 1 minute).
If that's the case, what I am suggesting is that when person A opens the
document, you record the SERVER time in a database or text file. Then
when person B hits the same document, PHP compares the time elapsed on
the server between when Person A and Person B accessed the document, ie:
whether or not its been less than / greater than 5 minutes.
Sorry to be of so little help!
.
- Follow-Ups:
- References:
- Prev by Date: Re: PREG_MATCH and arrays
- Next by Date: freeing memory
- Previous by thread: Re: deleting cookies and local browser time versus server time
- Next by thread: Re: deleting cookies and local browser time versus server time
- Index(es):
Relevant Pages
|
|