為了改善您的使用體驗,本網站正在進行維護,部分功能暫時無法使用。若本站的文件無法解決您的問題,想要向社群發問的話,請到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 發問,我們的社群成員將很快會回覆您的疑問。

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

Cookie changes the value after firefox reopenening

  • 2 回覆
  • 3 有這個問題
  • 3 次檢視
  • 最近回覆由 redigast13

more options

In my website I change a cookie value and a cookie lifetime on POST request. After the cookie is changed my website reloads the page (header: Location {url}). Then if a user will close browser and reopen it the cookie will have the value that was before changing.

Here is a link with php example on stackoverflow: http://stackoverflow.com/questions/28691649/why-this-cookie-changes-value-after-browser-reopening

Here is php code: ini_set('session.cookie_lifetime', 86400); session_regenerate_id(true);

   header('Location: http://localhost/sessiontest/');
   return;

} print_r($_COOKIE); ?>

<form method="post" action=""> <input type="text" name="test"> <input type="submit"> </form>

In my website I change a cookie value and a cookie lifetime on POST request. After the cookie is changed my website reloads the page (header: Location {url}). Then if a user will close browser and reopen it the cookie will have the value that was before changing. Here is a link with php example on stackoverflow: http://stackoverflow.com/questions/28691649/why-this-cookie-changes-value-after-browser-reopening Here is php code: <?php // url: http://localhost/sessiontest/ session_start(); if (isset($_POST['test'])) { ini_set('session.cookie_lifetime', 86400); session_regenerate_id(true); header('Location: http://localhost/sessiontest/'); return; } print_r($_COOKIE); ?> <html> <form method="post" action=""> <input type="text" name="test" /> <input type="submit" /> </form> </html>

所有回覆 (2)

more options

You may have to change the defaults for cookie storage. For more details:

more options

guigs2 said

You may have to change the defaults for cookie storage. For more details:

Is it a temp solution? I can't say all my users to change browser's settings. This error occurs only in firefox. In chrome browser it works fine. I think that it is incorrect behavior in firefox. Because of this error users are logged out after browser's reopening.