How can I tell how old a cookie is with cgi.pm? 
Author Message
 How can I tell how old a cookie is with cgi.pm?

Hi,

How can I tell how old a cookie is with cgi.pm?

I would like to update the users cookie if it's more than a week old.
I've looked in the documentation but I couldn't find how to retreive
the cookie-age with cgi.pm.

Thank you

Jacob



Thu, 12 Aug 2004 10:29:44 GMT  
 How can I tell how old a cookie is with cgi.pm?
Quote:
> I would like to update the users cookie if it's more than a week old.
> I've looked in the documentation but I couldn't find how to retreive
> the cookie-age with cgi.pm.

store a date in the cookie?


Thu, 12 Aug 2004 15:42:54 GMT  
 How can I tell how old a cookie is with cgi.pm?
: > I would like to update the users cookie if it's more than a week old.
: > I've looked in the documentation but I couldn't find how to retreive
: > the cookie-age with cgi.pm.
: store a date in the cookie?

touche! :-)

Cheers,

Ross-c



Fri, 13 Aug 2004 11:02:49 GMT  
 How can I tell how old a cookie is with cgi.pm?
Jacob Nordgren wrote (in comp.lang.perl.misc):

Quote:
>How can I tell how old a cookie is with cgi.pm?

You  can't. It's not CGI.pm (mind the case), it's just that browsers
don't send all cookie properties back to the server. What the server
doesn't get, it can't pass on to your CGI scripts. For example, the path
on the server that a cookie is valid for, is not sent back with the
cookie. Neither is the expiration time.

Quote:
>I would like to update the users cookie if it's more than a week old.
>I've looked in the documentation but I couldn't find how to retreive
>the cookie-age with cgi.pm.

Then encode the day it was set in the cookie's value. For example, if
the first letter depends on what day it was sent, you can encode 26 days
(almost 4 weeks) with just one letter. Just let the cookie expire after,
say, 25 days, and you have no problem with wraparound.

p.s. Discussion of this topic would be better suited for the

--
        Bart.

--
PLEASE NOTE: comp.infosystems.www.authoring.cgi is a
SELF-MODERATED newsgroup. aa.net and boutell.com are
NOT the originators of the articles and are NOT responsible
for their content.

HOW TO POST to comp.infosystems.www.authoring.cgi:
http://www.thinkspot.net/ciwac/howtopost.html



Fri, 13 Aug 2004 05:44:01 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. cgi.pm cookie function - am I missing something?

2. CGI.pm, dynamic contents, and older IExplorer browsers

3. CGI.pm - what am I doing wrng?

4. HOw can I tell the line number of the expression I am running in a

5. Weirdness with CGI.pm cookies

6. CGI.pm 2.36 -- passing a cookie to a 2nd form

7. Cookies with CGI.PM

8. CGI.pm: How to redirect and set cookie ?

9. Cookies using the Perl CGI.pm module(s)

10. Can't retrieve Cookie with cgi.pm

11. creating cookie with CGI.pm

12. inserting a cookie into CGI.pm (bizarre question)

 

 
Powered by phpBB® Forum Software