[thelist] Trouble writing JS cookie in NN 4

Bob Haroche spambait at onpointsolutions.com
Fri Oct 18 11:02:00 CDT 2002

I'm having trouble with writing a cookie in NN4. The idea is to allow a
person to check a form box on a terms of service page, the effect of which
is to set a cookie allowing the visitor to bypass the TOS page in the

The script works in IE/Opera/NN 6 but not in NN4.  If the form is inside an
AP layer (div), NN4 reports it has no properties; if it's outside the <div>,
it works fine. Any ideas? TIA.

 Here's the simplified code:

<script language="JavaScript" type="text/javascript">
 expireDate = new Date

 if (document.cookie != "") {
  if (document.cookie.indexOf("TOSagreed=yes") >= 0) {
  location.href = "http://domain.com/next-page.html";

 function setCookie() {
  if (document.TOSform.RememberMe.checked == true) {
  document.cookie = "TOSagreed=yes;expires=" + expireDate.toGMTString();
// -->

<div id="Layer1" style="position:absolute; left:50px; top:50px; z-index:1">
  <form name="TOSform" method="post" action="">
    <input type="button"  value="Submit"
    <input type="checkbox" name="RememberMe" value="SkipPage">
    Skip this page in the future.

Bob Haroche
O n P o i n t  S o l u t i o n s

More information about the thelist mailing list