- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我已经使用 firebug 手动创建了两个 cookie:
Cookie1=value1; expires=Sat, 29 Mar 2014 06:21:54 GMT; path=/Ex05Cookie; domain=localhost; HttpOnly
Cookie2=value2; expires=Sat, 29 Mar 2014 06:21:54 GMT; path=/Ex05Cookie; domain=localhost:8080; HttpOnly
唯一的区别是域属性,一个是localhost
,另一个是端口号。
这是我尝试请求 http://localhost:8080/Ex05Cookie/
时的 HTTP header :
GET /Ex05Cookie/ HTTP/1.1
Host: localhost:8080
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Cookie: Cookie1=value1
Connection: keep-alive
Cache-Control: max-age=0
其中 header 仅包含域为 localhost
的 Cookie1。
为什么我的 firefox 不发送 Cookie2 而不是 Cookie1?
最佳答案
这由 https://stackoverflow.com/a/4212964/14731 回答和 RFC 6265 的作者:
If we were designing cookies today, we'd definitely make it per-port. However, cookies are widely used on the Internet today and making this sort of change would break too many sites. For the most part, cookies are "done" in the sense that I wouldn't expect them to change much.Unfortunately, that means we stuck with cookies not respecting port number.
来源:https://groups.google.com/d/msg/comp.infosystems.www.misc/6WXdQ2RFhG8/VvOUuR3FNAUJ
关于http - 为什么网络浏览器在发送 cookie 时不关心端口号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16271845/
我想通过 jQuery 在每个页面上用图像(HTML)替换特定的口号(文本),电子邮件地址中的口号除外。 首先我尝试了这个,但问题是它输出的是文本而不是 HTML jQuery("p").text(f
我是一名优秀的程序员,十分优秀!