Home > Article > Web Front-end > Why Do My Session Cookies Persist in Chrome Even After Closing the Browser?
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:
Further Reading:
For additional insights and discussion on this topic, refer to the following resources:
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!