-
Help with reading cookies
Well, I used to be able to. Now I can't. I read the tutorial that taught me the first time and I just can't make it work. Could anyone give a me a refresher on how to READ cookies with JavaScript? Keep it simple if you can haha. Thanks!
Last edited by twQ; 12-29-2009 at 04:46 AM.
Reason: Changed wording. JavaScript doesn't have special cookies...
-
-
The simple answer is:
Code:
alert(document.cookie);
That will give you all of the javascript cookie info for that page. You can parse it any way that you like. Here's my unit (gleaned from the work of many others, then condensed - there are other cookie units out there) that works for most situations:
http://www.dynamicdrive.com/forums/blog.php?b=32
-
The Following User Says Thank You to jscheuer1 For This Useful Post:
-
Thank you for that, and I'll use your code for now but I'm going to try to learn how to do it on my own again I always feel like I'm stealing if I use a script that I don't understand...and since I don't remember how to read cookies I don't understand it haha. Thank you for the script I should be able to figure what I need from it.
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks