Thomas Krebs wrote on 25 Nov 2003:
Is it possible to set a cookie in a HTML file which is loaded
from the local filesystem (protocol is 'file:' instead of
'http')? It seems that I can set the cookie and I am also able
to access it as long as I do not close the browser. After I
close the browser, the cookie isn't there anymore.
I could not find it in the cookie file either.
I've used local cookies in both of my browsers (Opera and IE) when
testing and they are stored.
It sounds like you didn't set the expiry date when you added the
cookie. If you set it manually (using document.cookie), make sure
that the date is *not* quoted, and is of the form:
Wdy, DD-Mon-YY HH:MM:SS GMT
For example: EXPIRES=Thu, 27-Nov-2003 14:30:00 GMT
The Netscape cookie standard (not RFC 2109) expected a two-digit
year, but I imagine all modern browsers will (and should) accept the
full four.
Most setCookie functions use a Date object set to the expiry date,
rather than a string.
Mike
--
Michael Winter
M.******@blueyonder.co.uk.invalid (remove ".invalid" to reply)