[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Cookie Expiry question



Ronald J. Kimball wrote:

>> I've just started using CGI.pm and in the docs it states that:
>> 
>>      (CGI::expires() is the static function call used 
>>      internally that turns relative time intervals into 
>>      HTTP dates....)
>> 
>> When used, this creates an expiry date in the cookie of format:
>> 
>>      1241299336
>> 
>> Could someone please point me to an explanation of how this number is 
>> determined? What is the format of this HTTP date?
>> 
>
>Could you show us how you used CGI::expires() to create this date?

Certainly - through the following

     $cookie1 = $q->cookie(-name=>'fc',
               -value=>"$username:$password",
               -expires=>'+10y');

print $q->header(-cookie=>$cookie1);

In which the expiry date is obviously set to ten years into the future 
(which is probably not the date result I mentioned above, I just grabbed 
that from an arbitrary cookie in the prefs).

I'm reasonably certain I'm using the CGI.pm module correctly, but it's 
the date's format I'm curious about. What's happening inside 
CGI::expires()? Is there a standard to this format?



Cheers,
Chris

________________________________________________________________
             PostalCode, Inc.         (416) 203-1771 

               "Better living through multimedia."
________________________________________________________________


===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org