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:

  • The browser settings have been checked, and are configured to allow cookies. (first and 3thd party).
  • Multiple browsers have been used to test, it occurs in all (Chrome, IE8-9-10-11, Safari, Firefox, Opera)
  • Multiple Servers (MS 2000, 2003, 2008)

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.

È stato utile?

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
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top