PDA

View Full Version : Sending a cookie without using setcookie().


shakey snake
03-10-2003, 04:21 PM
So i am trying to send a cookie that expires 30 mins after you visit the web page (its so you can't load the ballot box on a survey).And this is what I have so far that doesn't work in the body tags:

<script LANGUAGE="JavaScript">
var exp = new Date();
exp.setTime(exp.getTime() + (30*60*1000));
document.cookie="nroc"+"="+"none repeat offender cookie"+"expires="+exp.toGMTString()+"\;\n";
</script>

I must have tried just about everything. I'd be happy if you had a solution using setcookie(), but i thought it'd be easier without it.

Skyzyx
03-10-2003, 04:26 PM
Well, there are some pretty good cookie objects that some of us threw together here: http://www.codingforums.com/showthread.php?s=&threadid=11585

Perhaps you could try one. It'd make setting cookies pretty easy...