I am asking this here because I need to adjust my script to deal with this situation. I have a cookie check line like so :
my $bhangs = $q->cookie(-name=>"current_bhangs") || set_cookie($q); sub set_cookie { my $q = shift; $val="schicken fu"; my $cookie = $q->cookie ( -name=>"bhangs", -value=>"$val", -expires=>"+2m"); print $q->redirect(-url=>url, -cookie=>$cookie); exit; }
problem is that the the cookie should be set to expire 2 minutes after it is set and I have found that if the time on the server and the time on the PC's internal clock are a mismatch ( as they will almost always be ) the browser chases its tail all day setting the cookie and checking to find it is already expired ad infinitum. Since I can't track the process via the cookie and tell the script it has a time mismatch since it successfully set the cookie less than 2 server clock seconds ago...I am at a loss. Should I abandon cookies and have the script sleep for 2 minutes instead of doing a cookie check?
Any advice greatly appreciated.
TIA
jg
_____________________________________________________
It's not my tree.

In reply to Slightly OT: How to Code for Incorrect Clocks and Rapidly Expiring Cookies by jerrygarciuh

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.