jerrygarciuh has asked for the wisdom of the Perl Monks concerning the following question:
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?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; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Slightly OT: How to Code for Incorrect Clocks and Rapidly Expiring Cookies
by perrin (Chancellor) on Feb 28, 2002 at 19:50 UTC | |
|
Re: Slightly OT: How to Code for Incorrect Clocks and Rapidly Expiring Cookies
by beebware (Pilgrim) on Mar 02, 2002 at 17:47 UTC | |
|
Re: Slightly OT: How to Code for Incorrect Clocks and Rapidly Expiring Cookies
by jerrygarciuh (Curate) on Feb 28, 2002 at 19:43 UTC |