can't find the javascript cookie anywhere

  • Thread starter Thread starter Jason Shohet
  • Start date Start date
J

Jason Shohet

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
 
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
 
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.
 
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.
 
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', '', '', '', '')"
 
Back
Top