can't find the javascript cookie anywhere

Discussion in 'ASP .Net' started by Jason Shohet, May 11, 2004.

  1. Jason Shohet

    Jason Shohet Guest

    I'm writing a js cookie from an asp.net page. A .NET cookie won't do.
    Inside the js func. that writes the cookie, I do this code to see the cookie
    afterwards:

    window.document.write(document.cookie);

    That shows me this on the asp.net page:
    machinename=jshohet; ASP.NET_SessionID=adt2......

    So I know the cookie is being written. Otherwise i wouldn't see the name I
    gave it (machinename) and the value (jshohet). Prob is, I'm looking in
    documents & settings for the logged in user & i don't see a cookie in it,
    except for some yahoo cookie ;)

    TY for any help J. Shohet
     
    Jason Shohet, May 11, 2004
    #1
    1. Advertising

  2. Jason Shohet

    Patrice Guest

    If you don't have an expiration date, this is a temporary cookie (ie. the
    cookie is cleared when IE closes ; technically it is likely in memory rather
    than being persisted to a file).

    Patrice

    "Jason Shohet" <> a écrit dans le message de
    news:%...
    > I'm writing a js cookie from an asp.net page. A .NET cookie won't do.
    > Inside the js func. that writes the cookie, I do this code to see the

    cookie
    > afterwards:
    >
    > window.document.write(document.cookie);
    >
    > That shows me this on the asp.net page:
    > machinename=jshohet; ASP.NET_SessionID=adt2......
    >
    > So I know the cookie is being written. Otherwise i wouldn't see the name

    I
    > gave it (machinename) and the value (jshohet). Prob is, I'm looking in
    > documents & settings for the logged in user & i don't see a cookie in it,
    > except for some yahoo cookie ;)
    >
    > TY for any help J. Shohet
    >
    >
     
    Patrice, May 11, 2004
    #2
    1. Advertising

  3. Jason Shohet

    Jason Shohet Guest

    hi Patrice
    Without closing the browser, I go to documents & settings, & I dont' see the
    cookie. I see others there, but not the one I just wrote. Its just not
    there. I'm using IE 6 on XP. I've tried it with setting expiration &
    without, and the cookie is never there, even though the browser is still
    open.



    > > I'm writing a js cookie from an asp.net page. A .NET cookie won't do.
    > > Inside the js func. that writes the cookie, I do this code to see the

    > cookie
    > > afterwards:
    > >
    > > window.document.write(document.cookie);
    > >
    > > That shows me this on the asp.net page:
    > > machinename=jshohet; ASP.NET_SessionID=adt2......
    > >
    > > So I know the cookie is being written. Otherwise i wouldn't see the

    name
    > I
    > > gave it (machinename) and the value (jshohet). Prob is, I'm looking in
    > > documents & settings for the logged in user & i don't see a cookie in

    it,
    > > except for some yahoo cookie ;)
    > >
    > > TY for any help J. Shohet
    > >
    > >

    >
    >
     
    Jason Shohet, May 11, 2004
    #3
  4. Jason Shohet

    Jason Shohet Guest

    could it be that .NET's index.dat file is taking over for the javascript,
    and somehow stuffing my cookie in there :(
    I do see index.dat's date in the documents & settings for the logged in
    user, updated to the time i set the cookie, but could just be coincidence.
     
    Jason Shohet, May 11, 2004
    #4
  5. Jason Shohet

    Jason Shohet Guest

    its not in the index.dat, i'm sure of that. But the js cookie is not being
    written it seems. Here's my js func.

    <script language="javascript">
    function setCookie(name, value, expires, path, domain, secure)
    {
    document.cookie= name + "=" + escape(value) +
    ((expires) ? "; expires=Mon, 27-Apr-2005 00:00:00 GMT) +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : ""); */

    window.document.write(document.cookie);
    }
    </script>

    And I'm calling it from the onkeyup of an asp.NET textbox:
    onkeyup="setCookie('machinename', 'shohet', '', '', '', '')"
     
    Jason Shohet, May 11, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shapper
    Replies:
    1
    Views:
    384
    Scott Allen
    May 6, 2005
  2. Julia Briggs
    Replies:
    2
    Views:
    2,895
  3. Julia Briggs
    Replies:
    0
    Views:
    938
    Julia Briggs
    Jun 27, 2003
  4. Vikram Bhatia
    Replies:
    1
    Views:
    237
    kaeli
    Oct 11, 2003
  5. HorseGeek
    Replies:
    2
    Views:
    96
    kaeli
    Apr 5, 2004
Loading...

Share This Page