http cookie

服务器会下发cookie,在http头里,所以设置cookie的代码必须再任何echo之前。 HTTP/1.1 200 OK Date: Tue, 06 Nov 2018 02:52:24 GMT Server: Apache/2.2.9 PHP/5.2.6 X-Powered-By: PHP/5.2.6 Set-Cookie: user=Abert+Lion; expires=Tue, 06-Nov-2018 03:52:24 GMT Content-Length: 6 Content-Type: text/html cookie ======================================================================= 浏览器第二次请求的时候会上送cookie GET /a HTTP/1.1 Host: 127.0.0.1:8080 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:44.0) Gecko/20100101 Firefox/44.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3 Accept-Encoding: gzip, deflate Cookie: user=Abert+Lion Connection: keep-alive Cache-Control: max-age=0

posted on 2018-11-06 11:06  阮減显  阅读(87)  评论(0编辑  收藏  举报

导航