Solution to the problem: The browser was configured to "Delete browsing history on exit", which included the removal of cookies.
This option overrides any settings to keep cookies.
Domanda
I am having an issue with keeping persistent cookies.
Problem:
With below code, I am able to create a cookie and keep it during the entire browser session. However, when I close the browser the cookie is removed after a few seconds.
Points that have been checked:
So I've got the following code in classic ASP:
Response.Cookies("user").expires= DateAdd("m",1,now())'looks like: 5/29/2014 3:53:13 PM'
Response.Cookies("user")("org")=request("org")
In short: My persistent Cookie keeps getting removed!
Any help would be greatly appreciated.
Soluzione
Solution to the problem: The browser was configured to "Delete browsing history on exit", which included the removal of cookies.
This option overrides any settings to keep cookies.
Altri suggerimenti
try this way:
Response.Cookies("user").expires= DateAdd("m",1,now())
if request("org")<>"" then
Response.Cookies("user")("org")=request("org")
end if