内部网域上的Cookie [英] Cookie on an intranet domain
问题描述
我在我们的办公室里有一台位于防火墙后面的开发服务器。主机名是franklin。
I have a dev server in our office that is behind the firewall. The hostname is franklin. We name all our servers after scientists or inventors.
当我设置HTTP cookie时:
When I set an HTTP cookie:
Set-Cookie: user=kenny; expires=1245424860.11; Path=/; domain=franklin
Cookie未设置。我尝试了下面没有运气。
The cookie doesn't set. I have tried the following with no luck.
.franklin
.franklin.local
franklin.local
.franklin.localdomain
franklin.localdomain
主机名不同,或者我可以通过一些魔法来设置这个cookie我不知道已经?
Do I have to set the hostname to something different or can I set this cookie through some magic I don't know already?
推荐答案
RFC 2109 说:
为了防止可能的安全或隐私违规,如果以下任何
为真,用户代理
拒绝 Cookie(不得存储其信息):
To prevent possible security or privacy violations, a user agent rejects a cookie (shall not store its information) if any of the following is true:
- Domain属性的值不包含嵌入的点,或
不以点开头。 - 请求主机的值不与域
属性进行域匹配。
还有:
域默认为请求主机。
Domain Defaults to the request-host.
如果您的主机 franklin
:
-
domain = .franklin
将被拒绝,因为它没有嵌入点。 - Cookie
domain =。
- Cookies with
domain=.franklin
will be rejected, because it has no embedded dot. - Cookies with
domain=.franklin.local
will be rejected, because it does not match the actual host name of your server.
这篇关于内部网域上的Cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!