【问题标题】:Domain-wide cookies not saving in Chrome for .uk Second Level Domain.uk 二级域的域范围 cookie 未保存在 Chrome 中
【发布时间】: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


【解决方案1】:

在测试了几个不同版本的 Google Chrome 之后,36 之前的版本如何处理 .uk 二级域 (SLD) 似乎存在问题。

我搜索了更改日志,发现版本 36 之前的版本使用旧版本的 public suffix list

This is the change that fixes Chrome to allow .uk domains to work correctly

【讨论】:

    猜你喜欢
    • 2012-11-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-29
    • 2017-07-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多