Chrome 不会删除会话 cookie [英] Chrome doesn't delete session cookies
问题描述
我正在尝试在 javascript 中设置会话 cookie,如下所示:
I'm trying to set session cookie in javascript like this:
document.cookie = 'name=alex; path=/'
但是即使我退出浏览器并再次启动它,Chrome 也不会删除它.
But Chrome doesn't delete it even if I quit browser and launch it again.
我检查了 Firefox 和 Opera,它们都按预期工作 - 它们在浏览器退出时删除会话 cookie.
I checked in Firefox and Opera and both work as intended - they delete session cookie on browser exit.
Chrome 是否只是忽略了过期规则?
Is Chrome just ignoring expiration rules?
我检查了多个操作系统,发现会话 cookie 在 Windows XP 和 Ubuntu 中的 Chrome 上被删除,但在 Mac OSX Lion 中没有.
I checked in multiple OSes and found out that session cookie gets removed on Chrome in Windows XP and Ubuntu, but NOT in Mac OSX Lion.
推荐答案
这可能是由于将 Chrome 设置为从上次停止的地方继续造成的.
This can be caused by having Chrome set to Continue where you left off.
- 错误报告:Chrome 没有删除临时 cookie——即没有登录我当我关闭所有浏览器窗口时自动退出
- Chromium 中的问题 128513:Chrome 进程关闭时未清除会话 Cookie
- 问题 128567:仅会话 cookie 不会删除
这篇关于Chrome 不会删除会话 cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!