Unable to read a cookie

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Drummond

    #1

    Unable to read a cookie

    I have set up two pages. The first writes a cookie and the second
    checks for its exsistence. If you follow the link to
    http://www.gadnet.com/test1.htm?test it will write a cookie named
    gadmcookie. This works fine. But when you go to
    http://www.gadnet.com/test.htm to check for the existence of the
    cookie, it is unable to find it. Any ideas what I am doing wrong?
  • kaeli

    #2
    Re: Unable to read a cookie

    In article <f8e34a78.03100 60533.7484a26e@ posting.google. com>,
    info@gadnet.com enlightened us with...[color=blue]
    > I have set up two pages. The first writes a cookie and the second
    > checks for its exsistence. If you follow the link to
    > http://www.gadnet.com/test1.htm?test it will write a cookie named
    > gadmcookie. This works fine. But when you go to
    > http://www.gadnet.com/test.htm to check for the existence of the
    > cookie, it is unable to find it. Any ideas what I am doing wrong?
    >[/color]

    I think you wanted this
    if (GetCookie('gad mcookie') == null) {
    document.writel n('exists');
    }
    else {
    document.writel n('does not exist');
    }

    To be

    if (GetCookie('gad mcookie') != null) {
    document.writel n('exists');
    }
    else {
    document.writel n('does not exist');
    }

    Assuming GetCookie returns the cookie if it exists and null if it
    doesn't, which is what it looked like.

    -------------------------------------------------
    ~kaeli~
    All I ask for is the chance to prove that money
    cannot make me happy.


    -------------------------------------------------

    Comment

    • W d'Anjos

      #3
      Re: Unable to read a cookie

      Drummond,

      It's working fine for me. Maybe your security setting is blocking
      your cookie somehow.

      I hope this helps.

      -Wagner

      info@gadnet.com (Drummond) wrote in message news:<f8e34a78. 0310060533.7484 a26e@posting.go ogle.com>...[color=blue]
      > I have set up two pages. The first writes a cookie and the second
      > checks for its exsistence. If you follow the link to
      > http://www.gadnet.com/test1.htm?test it will write a cookie named
      > gadmcookie. This works fine. But when you go to
      > http://www.gadnet.com/test.htm to check for the existence of the
      > cookie, it is unable to find it. Any ideas what I am doing wrong?[/color]

      Comment

      Working...