Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Cookie does not survive when Browser is closed #74

Closed
besi opened this Issue · 3 comments

4 participants

@besi

I set a cookie if it does not exist and set the value to 0. However, as soon as I close the browser the cookie gets deleted.

var loginCount = parseInt($.cookie("loginCount"));

if(!loginCount){
  $.cookie("loginCount", 0, { expires: 7 });
  loginCount = 0;
  alert("Cookie created");
}

$("#numberOfLogins").text(loginCount);

// cookie is incremented upon login
@Krinkle

That likely means either your incremental script is broken or your browser doesn't support cookies. Please include the relevant code.

Example (works fine): http://jsbin.com/ejefit

@FagnerMartinsBrack
Collaborator

Probably you marked your browser to delete the cookies when closing it or you are using chrome on localhost (http://stackoverflow.com/questions/7346919/chrome-localhost-cookie-not-being-set)

@carhartl
Owner

Quickly tested in Safari and Firefox, no issues. Please provide a proper test case.

@carhartl carhartl closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.