Re: deleting cookies and local browser time versus server time



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!
.



Relevant Pages

  • Re: Bypass Authentication
    ... "Joe Kaplan" wrote: ... authentication cookie back to the Server at Location 3 from Location 1. ... the Third Party application to use this program to launch the browser. ... Assuming that the server at location 3 requires a cookie to be sent to it ...
    (microsoft.public.dotnet.security)
  • Re: Bypass Authentication
    ... Joe Kaplan-MS MVP Directory Services Programming ... authentication cookie back to the Server at Location 3 from Location 1. ... the Third Party application to use this program to launch the browser. ... Assuming that the server at location 3 requires a cookie to be sent to it ...
    (microsoft.public.dotnet.security)
  • Re: password questions
    ... What's usually done in the PHP world is that the first time a browser ... goes to a site, it has no cookie, and says so when asked for one. ... server then asks for username and password, ... A cracker makes a request, trying to masquerade as the authenticated ...
    (comp.lang.java.programmer)
  • RE: forms authentication cookie problem
    ... authentication cookie. ... what's going on on the server. ... >324488 Forms Authentication and View State Fail ... >characters, the browser will still request the page, but ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Cookie Expire
    ... > But you don't have set the Cookie expire to yesterday. ... the information about the expiration date must be transmitted to ... the browser so that it can remove the cookie. ... >> Private Sub RemoveCookies() ...
    (microsoft.public.dotnet.framework.aspnet)