[thelist] Cookie Help - Mozilla problem

Andrew Clover and-evolt at doxdesk.com
Fri Jul 30 13:52:47 CDT 2004


John Spurgin <johns at net-communities.co.uk> wrote:

> Response.Cookies("cookieName").Expires = "July 31, 2000"

The expires date in Cookies has a specific date format, which browsers 
tend to be quite picky about. The original date format was defined by 
Netscape to be like:

   Wdy, DD-Mon-YY HH:MM:SS GMT

This is of course a stupid format as (a) it has a superfluous weekday, 
(b) the weekday and month are names in a language, (c) it has a 
two-digit-year, (d) it has a timezone in it ARGH, and (e) it's not a 
valid string from which to make a JavaScript Date object nor a 
particulary easy string to generate from a JavaScript Date object.

These days you can use a four-digit year and all browsers should accept 
it (hopefully few of your readers will be using Netscape 3). But 
fiddling with the rest of the format is not generally advisable (though 
I don't know of a browser than complains if you get the weekday wrong).

-- 
Andrew Clover
mailto:and at doxdesk.com
http://www.doxdesk.com/


More information about the thelist mailing list