...

View Full Version : writing javascript session cookies, weird function behavior



glz
08-27-2007, 05:07 AM
I running this code:

function testCookie() {
document.cookie = "testSessionCookie=Enabled";
if (getCookieValue ("testSessionCookie") == "Enabled") {
alert('works!');
} else {
alert('does not work!');
}
}

testCookie();



It doesn't alert anything at all! what am I doing wrong?
I am familiar with php cookies, regular cookies vs. session ones...etc..
I am not with javascript ones..

What I want to do is create session cookies with javascript so that they immediately be destroyed, if there is no way to make session variables with JS, then i'll settle for a way to destroy them immedietaly

Thanks for the help :)

Philip M
08-27-2007, 09:04 AM
Lots of good tutorials available:-

http://www.braemoor.co.uk/software/cookies.shtml

http://www.wsabstract.com/javatutors/cookie.shtml



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum