Image

writing , deleting a cookie

I am going nuts. I have google and tried a dozen solutions...
(orig crap deleted)


SOLVED:
I decided to change how I write the cookie and add an expiration time. I think that was the problem.

function setCookie(name, value){
var today = new Date();
today.setTime (today.getTime() + 10 *60 * 1000); // ten minutes
var path = "/";
document.cookie=name + "="+value+"; expires=" + today.toGMTString() + "; path=" + path;
}


And then I modified the delete script:
function deleteCookie(name){
var today = new Date();
today.setTime (today.getTime() - 28 * 24 * 60 * 60 * 1000); // less 28 days
var path = "/";
document.cookie=name + "=null; expires=" + today.toGMTString() + "; path=" + path;
}