Google Chrome 中的 Cookie 有时不会创建
几天以来,我观察到 Google Chrome 中与 Cookie 相关的奇怪行为。
我有三个环境:
- HTTPS://somedomain.com (发布环境)
- HTTP://dev.somedomain.com (开发环境)
- HTTP://demo.somedomain.com (演示的开发环境)
示例: A. 用于开发环境。 (HTTP://dev.somedomain.com 和 HTTP://demo.somedomain.com)
- 周一一切正常
- 周四 Google Chrome 删除会话 cookie“ci_session”(cookie 消失)并且 webapp 无法再重新生成它
- 当我清除时Google Chrome 浏览数据一切恢复正常,但几天后情况会重复
B. 对于发布环境。 (HTTPS://somedomain.com)
- 问题也不存在
- ,即使我手动删除会话 cookie“ci_session”webapp 重新生成它也没有问题
C. 对于本地环境 (HTTP://localhost)
- 问题也不存在
- ,即使我手动删除会话 cookie“ ci_session” webapp 重新生成它没有问题
我的评论:
似乎存在问题:
- 仅在 Google Chrome 中(不在 Safari、Opera、Edge、Firefox 中)
- 仅适用于 HTTP,不适用于 HTTPS 协议
- 或/且仅适用于子域(但我不确定这是否属实)
- 当我运行安装在我的 PC 开发环境上的本地 webapp 时,安装在互联网(托管服务器)上的 webapp 的退出
- 不存在。
- 问题发生在两台不同的 Win10 和 Windows 电脑上Chrome
请帮忙:
- 有什么想法如何处理这个问题吗?
- 去哪里查找原因呢?
- 我可以检查什么?
- 任何建议都会有帮助
我的配置:
- 托管服务器上的Windows 10
- 最新 Google Chrome
- Web 应用程序(非本地)
- PHP 7.4
- CogeIgniter 3.1.11
- config.php:
$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 86400; //=24h (1h=3600)
$config['sess_save_path'] = NULL;
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;
$config['cookie_prefix'] = '';
$config['cookie_domain'] = '';
$config['cookie_path'] = '/';
$config['cookie_secure'] = FALSE;
$config['cookie_httponly'] = FALSE;
Since few days I observed strange behaviour in Google Chrome connected with Cookies.
I have three environments:
- HTTPS://somedomain.com (release env)
- HTTP://dev.somedomain.com (development env)
- HTTP://demo.somedomain.com (development env for demo)
Example:
A. for development env. (HTTP://dev.somedomain.com and HTTP://demo.somedomain.com)
- On Monday everything works fine
- On Thursday Google Chrome removes session cookie "ci_session" (cookie disapeared) and webapp cannot regenerate it again anymore
- When I clear Google Chrome browsing data everything back to normal but the situation repeats in couple days
B. for release env. (HTTPS://somedomain.com)
- problem not exists
- even If I manualy remove session cookie "ci_session" webapp regenerate it without problems
C. for local env (HTTP://localhost)
- problem not exists
- even If I manualy remove session cookie "ci_session" webapp regenerate it without problems
My comments:
It seems that the problem exists:
- only in Google Chrome (not in Safari, Opera, Edge, Firefox)
- only for HTTP and not for HTTPS protocol
- OR/AND only for subdomain (but I am not sure if it is true)
- exits for webapp installed on the internet (hosted server)
- not exists when I run webapp localy installed on my PC development env.
- problem occured on 2 different PCs with Win10 & Chrome
Please help:
- Any ideas how to handle this issue?
- Where to search the reason?
- What I can check?
- Any suggestion can be helpful
My configuration:
- Windows 10
- newest Google Chrome
- Web app on hosting server (not local)
- PHP 7.4
- CogeIgniter 3.1.11
- config.php:
$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 86400; //=24h (1h=3600)
$config['sess_save_path'] = NULL;
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;
$config['cookie_prefix'] = '';
$config['cookie_domain'] = '';
$config['cookie_path'] = '/';
$config['cookie_secure'] = FALSE;
$config['cookie_httponly'] = FALSE;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论