Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
more useful options
 
PerlMonks  

Re: (nrd) Cookie expires inaccurately

by newrisedesigns (Curate)
on Dec 28, 2002 at 15:06 UTC ( #222733=note: print w/ replies, xml ) Need Help??


in reply to Cookie expires inaccurately

Your browser throws away the cookie when the date set by the server has passed. If your server's time and your local time are off (by 1 minute, ~10 seconds) cookies will expire prematurely.

I suggest using some other form of session-time verification, like time-in-url or record the session time on the server only. I also highly suggest against cookies altogether, considering they are unreliable in every browser.

Hope this helps... if not, post a reply!

John J Reiser
newrisedesigns.com


Comment on Re: (nrd) Cookie expires inaccurately
Re: Re: (nrd) Cookie expires inaccurately
by BioHazard (Pilgrim) on Dec 28, 2002 at 15:21 UTC
    You are right!
    The server's time and my local differ. But only ~40 seconds. I hope that is the problem, because now the cookie is set when I try -expires => "+30s" but is not thrown away after this time :(. I am thinking about getting away from cookies, too. Many people have told me great advantages of other session-time verfication.
    There is just one point I do not understand (It's silly perhaps): A server in America with 6 hours difference for example (I am from Germany) will give me correct cookie (-times), right? Then how does the server do it?

    Thanks for your suggestions :)

    BioHazard
    reading between the lines is my real pleasure
      The expiry time in the cookie is always GMT.
      poj

      It will give you the correct time because it will use GMT.

      You can always check if cookies are set by telneting to your server using port 80, then typing "GET /document.html" replacing "document.html" with the path of your file or CGI. (ie. "GET /cgi-bin/index.pl" or "HEAD /cgi-bin/index.pl" to get just the headers.)

      Hope this helps.

      John J Reiser
      newrisedesigns.com

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://222733]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2014-04-20 09:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls