Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Correct expiration date format for cookies

by Anonymous Monk
on Aug 14, 2006 at 07:30 UTC ( #567163=perlquestion: print w/ replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello monks!

This question doesn't really have a lot to do with Perl, but I am using Perl so I hope it's permissible to ask this here.

I am writing a Perl CGI program, which uses cookies, and I was just wondering what the correct way to format the expiration date is. When I use google and some books that I have, all of the answers are different. I gather that most browsers will accept several formats without complaint, but what is the official one?

Comment on Correct expiration date format for cookies
Re: Correct expiration date format for cookies
by davorg (Chancellor) on Aug 14, 2006 at 07:44 UTC

    The documentation for CGI.pm's "header" method contains an example of the format required - Thursday, 25-Apr-1999 00:40:33 GMT. But it's usually easier to use one of the abbreviated formats like '+1d' or '+1y'.

    --
    <http://dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg

Re: Correct expiration date format for cookies
by Tomte (Priest) on Aug 14, 2006 at 08:30 UTC

    According to the RFC 2965 Max-Age for a cookie is expressed as positive integer with the meaning "seconds from now on" - in difference to the cache-controling expiration header, which has to follow the date-formats specified in RFC 2616, of which the format mentioned in the CGI.pm-documentation is one.

    regards,
    tomte


    An intellectual is someone whose mind watches itself.
    -- Albert Camus

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (15)
As of 2014-07-28 19:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (207 votes), past polls