PDA

View Full Version : Cookie Problem


flash
01-06-2003, 10:41 AM
Hello everyone.

Here is the situation:

I have a page, when it loads a window pops up.

I need to somehow make it so that when a button is pressed to close the window, the window sets a cookie which means that the next time that person visits the site, the popup window no longer shows.

I do not have much cookie experience and ive been trying to edit cookie scripts for a while now with no luck..

Any help would be great :thumbsup:

Thanks.

joeframbach
01-06-2003, 12:17 PM
var cookUsers=document.cookie;
if(cookUsers.indexOf("prev_visit:true"))
return false;
else
{
alert("Welcome to my site!")
var exDate=new Date("December 31, 2023");
document.cookie="cookUsers="+unescape("prev_visit:true")+"; expires="+exDate.toGMTString()
}


that should do it