[Linux][HTTP] Cookie和Set-Cookie

Posted yiyide266

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[Linux][HTTP] Cookie和Set-Cookie相关的知识,希望对你有一定的参考价值。

HTTP 请求报文通过Cookie字段通知服务端当前页面的域生效中的cookie;

GET /my/login.php HTTP/1.1
Host: 192.168.88.207:91
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (Khtml, like Gecko) Chrome/58.0.3029.110 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Referer: http://192.168.88.207:91/my/p_login.php
Accept-Encoding: gzip, deflate, sdch
Accept-Language: zh-CN,zh;q=0.8
Cookie: adp_16_index=0; adp_17_index=0; d18e8e09e49956787fd35cd64f931365=2017-10-27; adp_5_index=0; adp_6_index=0; adp_8_index=0; adp_9_index=0; 61ab7b0cdd217749ebb258da281080b8=2017-11-10; adp_2_index=0; adp_1_index=1; adp_4_index=1; adp_3_index=0; login_tag=yep; qprc=1VzN5eHQ0MjAxNzA4MTUwNjM3MTg%3D; owner_id=CP2007; adv_id=336; adv_type=1; adv_ldp_id=20140909CHLL161; qpid_offer_id=CHL_2472TXOO; website_id=1; referer=http%3A%2F%2F192.168.88.207%3A10003%2Ftemp_94.html; adv_click_history_id=4862; owner_argv=a%3A3%3A%7Bs%3A3%3A%22aid%22%3Bs%3A3%3A%22336%22%3Bs%3A3%3A%22oid%22%3Bs%3A6%3A%22CP2007%22%3Bs%3A13%3A%22qpid_offer_id%22%3Bs%3A12%3A%22CHL_2472TXOO%22%3B%7D; quicklook-CM75753173=cl; quicklook-CM65368347=cd; quicklook-CMTS09981=cl; quicklook-CMT09981=cd; CL_Change_Screen=1680; quicklook-CM70803833=cd; language=en; IDA_Change_Screen=1680; LD_Change_Screen=1680; adp_35_index=0; CHNCOOKAUTOSTA=Y; CHNCOOKAUTOSID=V%2FEOswIBWSzYcPXm2vX80tuBVKPBrNzk; CHNCOOKAUTOTOKEN=flasnue3ymbueswh; CHNCOOKUID=yiyiyide%40163268.com; CHNCOOKSTA=Y; CD_Change_Screen=1680; PHPSESSID=ufhulbiv2oa0fcb1m06kfm7851

 HTTP响应报文通过Set-Cookie通知客户端需要保存如下cookie;

HTTP/1.1 302 Found
Date: Mon, 13 Nov 2017 00:46:23 GMT
Server: Apache/2.2.22 (Win32) PHP/5.3.13
X-Powered-By: PHP/5.3.13
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
Set-Cookie: CHNCOOKUID=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/my
Set-Cookie: CHNCOOKSTA=Y; expires=Mon, 13-Nov-2017 00:46:22 GMT; path=/my
Set-Cookie: PHPSESSID=ufhulbiv2oa0fcb1m06kfm7851; path=/
Set-Cookie: _beta_view_id=2; expires=Tue, 14-Nov-2017 00:46:25 GMT; path=/
Set-Cookie: CHNPOPUREG=yiyiyide%40163268.com; expires=Wed, 13-Dec-2017 00:46:25 GMT; path=/; domain=charmdate.com
Set-Cookie: vpstat_c=4MA%3D%3D; expires=Tue, 14-Nov-2017 00:46:25 GMT; path=/
Set-Cookie: vpstat_l=8QzEwMDAwMA%3D%3D; expires=Tue, 14-Nov-2017 00:46:25 GMT; path=/
Set-Cookie: CHNCOOKUID=yiyiyide%40163268.com; expires=Wed, 14-Nov-2018 00:46:25 GMT; path=/
Set-Cookie: CHNCOOKSTA=Y; expires=Wed, 14-Nov-2018 00:46:25 GMT; path=/
Location: /my/overview.php
Content-Length: 0
Keep-Alive: timeout=5, max=96
Connection: Keep-Alive
Content-Type: text/html

 

以上是关于[Linux][HTTP] Cookie和Set-Cookie的主要内容,如果未能解决你的问题,请参考以下文章

使用 HTTParty 解析 HTTP 标头“set-cookie”

Wininet 是不是处理 HTTP 标头值“Set-Cookie”?

AngularJS 忽略 HTTP 标头中的 Set-Cookie

http.getResponseHeader("Set-Cookie") 的问题.

Angularjs $http 似乎不理解响应中的“Set-Cookie”

set-cookie 和 cookie 的区别