[thelist] JS: Cookie Madness

Roger Ly evolt at matchpenalty.com
Tue Feb 3 16:15:31 CST 2004


Tom,

You can set an expiration date for each name/value pair for your
cookies.  

What liorean is saying is that when you query the document.cookie
property, it will only return to you the name/value pairs of the cookies
that are set for that particular domain.  It will not list the
expiration dates and/or paths of the cookies themselves.

If you want to actually view the cookies and verify that expiration
dates are set correctly, just take a peek at the cookies themselves as
explained earlier for Mozilla/Firebird.  If you are trying to check your
IE cookies, and you are on 2K or similar, you can look in 
C:\Documents And Settings\loginname\Local Settings\Temporary Internet
Files\ 

and find files called

Cookie:loginname at domainname.com/

Where loginname is the login you are using for 2k, and domainname.com is
the domain you want to check cookies on.

Open up these files and you can see the cookies that were set, along
with expiration date.  If you see files called 

somepath/

Those will be the cookies set for a specific path on a particular
domain.

I'm not sure how to actually query the expiration date or path of a
specific cookie in Javascript.  There probably is a way, but I don't
know how to do it (document.cookie will not do it for you though).

HTH,

Roger

 



More information about the thelist mailing list