artsapimp posted this at 22:27 — 26th February 2002.
They have: 330 posts
Joined: Apr 2000
Is it possible to read a cookies set by ASP using javascript?
Jack Michaelson posted this at 09:39 — 27th February 2002.
He has: 1,733 posts
Joined: Dec 1999
put them in a and read it with javascript. Is that what you're asking?
Peter J. Boettcher posted this at 14:36 — 27th February 2002.
They have: 812 posts
Joined: Feb 2000
Yes it is, but the cookie you create in ASP has to be the permanent kind (must specify expire date).
artsapimp posted this at 15:05 — 28th February 2002.
Yes, I am setting them to expired = Date + 1 which should make them available until midnight. Right? Is that what you meant?
How would I write this in javascript? The cookie name is "Access".
Thanks.
Free Math Test Fun Math Games
Peter J. Boettcher posted this at 15:54 — 28th February 2002.
I would use DateAdd instead:
Response.Cookies("Name").Expires = DateAdd("m",3,Now)
So this cookie would expire in 3 months.
Here's an example of a cookie in javascript:
function SetValue() { var expdate = new Date (); expdate.setTime (expdate.getTime() + (1000 * 60 * 60 * 24 * 365)); setCookie ("CookieName", "CookieValue", expdate);}function setCookie (name, value, expires) { if (!expires) expires = new Date(); document.cookie = name + "=" + escape (value) + "; expires=" + expires.toGMTString() + "; path=/"; }
Then in ASP you would just request that cookiename.
PJ | Are we there yet? pjboettcher.com
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.
Jack Michaelson posted this at 09:39 — 27th February 2002.
He has: 1,733 posts
Joined: Dec 1999
put them in a and read it with javascript.
Is that what you're asking?
Peter J. Boettcher posted this at 14:36 — 27th February 2002.
They have: 812 posts
Joined: Feb 2000
Yes it is, but the cookie you create in ASP has to be the permanent kind (must specify expire date).
artsapimp posted this at 15:05 — 28th February 2002.
They have: 330 posts
Joined: Apr 2000
Yes, I am setting them to expired = Date + 1 which should make them available until midnight. Right? Is that what you meant?
How would I write this in javascript? The cookie name is "Access".
Thanks.
Free Math Test
Fun Math Games
Peter J. Boettcher posted this at 15:54 — 28th February 2002.
They have: 812 posts
Joined: Feb 2000
I would use DateAdd instead:
Response.Cookies("Name").Expires = DateAdd("m",3,Now)
So this cookie would expire in 3 months.
Here's an example of a cookie in javascript:
function SetValue() {
var expdate = new Date ();
expdate.setTime (expdate.getTime() + (1000 * 60 * 60 * 24 * 365));
setCookie ("CookieName", "CookieValue", expdate);
}
function setCookie (name, value, expires) {
if (!expires) expires = new Date();
document.cookie = name + "=" + escape (value) +
"; expires=" + expires.toGMTString() + "; path=/";
}
Then in ASP you would just request that cookiename.
PJ | Are we there yet?
pjboettcher.com
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.