Home  >  Article  >  Web Front-end  >  Why Do My Session Cookies Persist in Chrome Even After Closing the Browser?

Why Do My Session Cookies Persist in Chrome Even After Closing the Browser?

DDD
DDDOriginal
2024-11-19 07:15:03630browse

Why Do My Session Cookies Persist in Chrome Even After Closing the Browser?

Chrome's Session Cookie Conundrum

Background:
When it comes to setting session cookies in JavaScript, the general expectation is that they should expire upon browser termination. However, users have encountered an anomaly with Chrome where session cookies persist even after closing the browser.

Problem Description:
The user consistently sets session cookies following standard practices. Despite this, Chrome retains the cookies beyond browser exits. The issue occurs in Mac OSX Lion, while other platforms like Windows XP and Ubuntu behave as anticipated.

Explanation:

Reason for Persistent Session Cookies in Chrome:

The aberrant behavior in Chrome stems from a specific setting: "Continue where you left off." When this option is enabled, Chrome aims to maintain browsing preferences, including session cookies, across browser sessions. This overrides the customary expiration rules for such cookies.

Solution:

To resolve this issue, one must disable the "Continue where you left off" setting:

  1. Open Chrome's Settings.
  2. Under the "History" section, uncheck the box labeled "Continue where you left off."
  3. Restart Chrome to apply the change.

Further Reading:

For additional insights and discussion on this topic, refer to the following resources:

  • Bug report: [Chrome is not deleting temporary cookies – i.e. not logging me out automatically when I close all browser Windows](https://bugs.chromium.org/p/chromium/issues/detail?id=128513)
  • Issue 128513 in Chromium: [Session Cookies not cleared when Chrome processes closed](https://bugs.chromium.org/p/chromium/issues/detail?id=128513)
  • Issue 128567: [Session only cookies don't delete](https://bugs.chromium.org/p/chromium/issues/detail?id=128567)

The above is the detailed content of Why Do My Session Cookies Persist in Chrome Even After Closing the Browser?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn