【发布时间】:2014-08-17 19:23:35
【问题描述】:
Google Chrome 似乎没有保存我的域范围会话 cookie。
我的服务器正在发送以下标头:
HTTP/1.1 200 OK
Date: Thu, 26 Jun 2014 19:42:48 GMT
Server: Apache
Set-Cookie: AuthID=a0dbc62667968c7d3c47dd80068a8b76; path=/; domain=.aerox.uk
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Length: 109
Keep-Alive: timeout=10, max=50
Connection: Keep-Alive
Content-Type: text/html
但在后续请求中,cookie 不会被发送回。如果我在 Internet Explorer 中尝试相同的页面就可以了。此外,如果我将其从域范围的 cookie 更改为特定于子域的 cookie,它也可以正常工作。
如果我单击地址栏中的页面图标并查看此域设置的 cookie,它会在允许或阻止列表中显示任何内容。
这是我的一些 cookie 配置。
在.htaccess:
# PHP Settings
php_value session.cookie_domain ".aerox.uk"
php_value session.name "AuthID"
#php_flag session.auto_start 1
php_value auto_prepend_file "../auto_header.php"
在auto_header.php:
<?php
session_name('AuthID');
session_set_cookie_params(0,'/','.aerox.uk');
session_start();
?>
【问题讨论】:
-
我已经在 Google Chrome Cancary (38.0.2076.0) 中尝试过这个,它按预期工作。我也在适用于 Android 的 Google Chrome (35.0.1916.141) 上尝试过这个,但它不起作用,而 PC 的发行版是 (35.0.1916.153)。
标签: php apache google-chrome cookies session-cookies