W3C home > Mailing lists > Public > www-lib@w3.org > July to September 2001

Quick fix for cookie EXPIRATION date processing problem

From: James D. Brown <jamesbrown@shopswell.com>
Date: Thu, 16 Aug 2001 00:06:12 -0400 (EDT)
To: www-lib@w3.org
Message-Id: <0108152205490N.01786@franz.shopswell.com>
A month or so ago, I sent e-mail to the list to mention a bug relating to 
accepting the expiration date on cookies, in that LIBWWW couldn't accept the 
date that the Perl CGI library generates, nor did it meet Netscape's own spec 
(mentioned on the documentation on www.w3c.org) for dates.

I was finally forced to go fix the problem in my copy of the code today, but 
not having any background in CVS, and not having the time right this minute 
to learn, I thought I'd forward my fix to the list in hopes that someone else 
could be so kind as to verify it and check it in for me.

The problem was not in the time parsing itself, but only in a validation 
check to verify that all the fields in a struct tm struct were reasonably 
populated.  In order to correct the validation and make the code work 
correctly with Netscape's date format, I added the following lines to 

< **            Wkd, 00-Mon-0000 00:00:00 GMT           (Netscape)
<     if (tm.tm_year > 1900) tm.tm_year -= 1900;
James D. Brown, President, Shopswell, Inc.
Voice: 303-400-0480 - FAX: 303-400-7181
http://www.shopswell.com - jamesbrown@shopswell.com
Received on Thursday, 16 August 2001 04:43:44 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:33:54 UTC