Please help with this cookie problem

When refreshing the cookie does everthing it is supposed to, I however have problems whren closing the window Please help.




Document Title



function stop()
{

var readCookie = unescape(document.cookie);
if(document.cookie != "")
{

var userCookie = readCookie.substring(readCookie.indexOf("=")+1,readCookie.lastIndexOf(";"));
document.bgColor= userCookie;
alert("User Color" + userCookie);
}
}

function go(color)
{

today = new Date();
document.bgColor = color;
var userCookie = "thiscolor=" + color + ";expires="+ today.setFullYear(today.getFullYear()+1);
alert("User Color" + userCookie);
document.cookie = escape(userCookie);


}


















Comments

  • Your code works just fine on my browser (IE5.5).

    : problems whren closing the window

    I don't see any problem at all when closing the browser, or do you mean when closing the ALERT window? I don't have problem if none of them!

    -- Secret_Doom - Leonardo Pignataro --

    secret_doom@hotmail.com
    www.batch.hpg.com.br

    : When refreshing the cookie does everthing it is supposed to, I however have problems whren closing the window Please help.
    (snipped code)
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion