无法在Safari 13中跨.test子域共享Cookie [英] Sharing cookies across .test sub-domains in Safari 13 not possible

查看:113
本文介绍了无法在Safari 13中跨.test子域共享Cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 https://example.test 和amp;的Apache的自证书。 https://m.example.test

I have a self-certificate for apache for https://example.test & https://m.example.test

何时使用PHP浏览 https://m.example.test Cookie设置为基本域 .example.test session.cookie_domain。此功能可在Chrome,Firefox或Safari 12以下版本的Safari中使用。
但是,它在Safari 13(iOS 13或Catalina)中不再起作用。

When browsing https://m.example.test cookies are set to the base domain '.example.test' using php 'session.cookie_domain'. This DOES work in Chrome, Firefox or Safari up-to-version-12. However, it does not work anymore in Safari 13 (iOS 13 or Catalina).

更奇怪的是Cookie仍设置为基准我的生产机器在Safari 13上使用 https://example.COM & https://m.example.COM

What's even more strange is that the cookie is still set to the base domain on Safari 13 with my production machine for https://example.COM & https://m.example.COM

I COM和TEST服务器具有相同的apache服务器配置。将我的iOS设备更新到iOS 13或在Catalina之后在MacOS中,它只是停止在我的开发 .test服务器上工作。 Chrome,Firefox仍然可以使用。即使是旧的iOS设备(通过代理连接到我的开发计算机)仍会将cookie存储到基本域 .example.test。因此,似乎它仅适用于Safari 13,并且仅在 .test域中。

I have the same apache server configuration for both the COM and TEST servers. It simply stopped working on my development ".test" server after updating my iOS devices to iOS 13 or in MacOS after Catalina. Chrome, Firefox still work. Even old iOS devices connecting to my development machine (through a proxy) still store the cookie to the base domain ".example.test". So it looks like it is something specific to Safari 13 and only in ".test" domains.

我使用Apple的最新建议为.TEST服务器创建了新证书。 (最长825天,依此类推),但没有任何区别。自签名证书似乎已发生某些变化。还是存在针对 .test(非公共)域的新规则?它是特定于Safari,。test非公共域或证书的内容。

I have created new certificates for my .TEST server using latest recommendations from Apple (max 825 days and so on) but it did not make any difference. It looks like something may have changed with self-signed certificates. Or perhaps a new rule exists for ".test" (not public) domains? It's something either specific to Safari, ".test" not-public-domains or certificates. Or something else I did not even think about.

任何想法如何配置Apache / Macosx /证书,以便我仍可以在开发中使用Safari 13在子域之间共享cookie。 .test网域?谢谢。

Any idea how to configure Apache/Macosx/certificates so that I can still share a cookie across subdomains using Safari 13 in development .test domains? Thanks.

推荐答案

此处与 .test TLD。它可以在Chrome浏览器中运行,但Safari 13不会设置cookie。

Same here with wildcard subdomains and cookies for the .test tld. It works in Chrome, but Safari 13 does not set the cookie.

我的解决方法是改用 .local 子域,然后一切正常。

My workaround was to use the .local subdomain instead, and everything works fine.

(按照@gueorgui的建议指定每个子域均无法正常工作,因为浏览器将为每个子域设置一个单独的cookie)

(Specifying each subdomain as @gueorgui suggested does not work as expected, because the browser will set a separate cookie for each subdomain)

这篇关于无法在Safari 13中跨.test子域共享Cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆