views:

629

answers:

2

I'm making a simple ajax login system using cookies to remember username or login automatically on the next visit. Everything works ok, the cookies are set 10 days to the future, I can see them when I go and see Firefox's cookies but they are deleted when I restart the browser. The cookies are set with setcookie() from a php script called using jQuery .get function. I tried .post too but the same happens. Firebug reports the Set-Cookie header correctly. I tried it on localhost, and on a real live server, I tried passing all the parameters to setcookie() because I read something that Firefox treats it as session cookie if you don't, I tried 2 dots on hostname and every possible solution I could find on the net. I don't see why it doesn't work...

A: 

have you tried any other browser? it could be that you configured your firefox to delete cookies every time it is closed.

take following steps:

  1. click options or preferences depending on your OS.
  2. click privacy
  3. un check "Always clear my private data".
Mohamed
A: 

Ok seems like it happens only on my browser, probably it's because it's Firefox portable.

Better to add this as an edit to your original question, not to place it as an answer. Further, portable Firefox likes to not leave traces behind, so it could be perfectly feasible that it's set up to delete cookies upon close.
cmptrgeekken