eladr
asked on
asp and cookies
i saved a cookie :
Response.Cookies ("transp")("emp_id") = "999"
Response.Cookies ("transp").Expires = DATE + 365
when i tried to retrieve the information
in other page the cookie was empty
i tried to retrieve it by:
cookie_emp_id=request.cook ies("trans p")("emp_i d")
response.write cookie_emp_id
what to do?
Response.Cookies ("transp")("emp_id") = "999"
Response.Cookies ("transp").Expires = DATE + 365
when i tried to retrieve the information
in other page the cookie was empty
i tried to retrieve it by:
cookie_emp_id=request.cook
response.write cookie_emp_id
what to do?
Response.Cookies("transp") .Expires = Now + CDbl(365)
ASKER
not working...
the cookie is "living" only in the same page.
the strangest thing is that was
working well yesterday
the cookie is "living" only in the same page.
the strangest thing is that was
working well yesterday
are dates not stored as milliseconds?
If so, adding 365 will be adding just under half a second to the expiry date.
could this be the problem?
If so, adding 365 will be adding just under half a second to the expiry date.
could this be the problem?
daveamour:
no, this is how to create a cookie with 5 days expritarion:
Response.Cookies("mycookie ").Expires
= date + (365*5)
xabi
no, this is how to create a cookie with 5 days expritarion:
Response.Cookies("mycookie
= date + (365*5)
xabi
Try this:
Response.Cookies("transp") .Path = "/"
xabi
Response.Cookies("transp")
xabi
ASKER
it's strange...
i changed the name of the cookie and everything is good now.
is someone has an idea?
i dont want it to happened again with
my new name.
elad
i changed the name of the cookie and everything is good now.
is someone has an idea?
i dont want it to happened again with
my new name.
elad
Try it. And say what do you get?
<%
Response.Write Request.Cookies ("transp")
Response.Cookies ("transp").Expires = -1
%>
<%
Response.Write Request.Cookies ("transp")
Response.Cookies ("transp").Expires = -1
%>
ASKER
this is the error:
Cookies object error 'ASP 0200 : 80004005'
Out of Range 'Expires' attribute
/orange/sa.asp, line 3
The date given for 'Expires' precedes Jan 1, 1980 or excedes Jan 19, 2038, 3:14:07 GMT.
Cookies object error 'ASP 0200 : 80004005'
Out of Range 'Expires' attribute
/orange/sa.asp, line 3
The date given for 'Expires' precedes Jan 1, 1980 or excedes Jan 19, 2038, 3:14:07 GMT.
Sorry
<%
Response.Write Request.Cookies ("transp")
Response.Cookies ("transp").Expires = Now()
%>
and try your code
<%
Response.Write Request.Cookies ("transp")
Response.Cookies ("transp").Expires = Now()
%>
and try your code
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.