Click to See Complete Forum and Search --> : set cookies


Alicia
11-26-2003, 09:03 PM
Hi guys,

currently i have a page where once it loads, the popup window will appear.. i am wondering is there anyway i can make it pop up only in the users first visit ? that means if the user press back, the pop up will not appear ?

p.s: my idea is to use cookie, but how can i do that ?

i tried to use this code but it doesn;t work...

my code:

if(cookieName ="")
{
window.open('popup.htm','','menubar=no,resizable=yes,width=430,height=580');
}

function xitpop()
{
if (exit)
{
form2.cookie = "cookieName=cookieValue";

window.open("http://www.myweb.com/exit_popup.htm","sample","height=500,width=604,status=yes,menubar=no,location=no,resizable=no,titlebar=yes,scrollbars=yes,top= 50,left=50");
}
}

// in onunload, my code will refer to xitpop() function.

Why this is not working ?? or do you guys have any better idea how to accomplish this task ?

Please advise.

soccer362001
11-26-2003, 09:15 PM
Have you set a cookie?

emblem
01-06-2005, 09:22 AM
try http://javascript.internet.com/cookies/only-popup-once.html