My problem is that I need to create a cookie that remember which css-file you choose if you have been at this site before. I have tried to solve this with document.cookie = "filename.css". This works perfect at my computer, if I put it out to my server it doesn't work at all. Could someone please help me?
06-01-2011, 02:05 PM
First of all, cookies work with NVP (Name Value Pair); all you are providing is the V, without the N. ("filename.css"). You need to do document.cookie = "thisFile = filename.css;";
Secondly, without an expire date the cookie is not planted on the user's hard drive; it's a session cookie that disappears as soon as you close the browser.