【发布时间】:2013-06-07 01:01:59
【问题描述】:
在我当前的应用程序中,PHPSESSID Cookie 被多次发送。这是一个示例响应:
HTTP/1.1 200 OK
Date: Tue, 11 Jun 2013 08:18:29 GMT
Server: Apache/2.2.17 (Ubuntu)
X-Powered-By: PHP/5.3.15-1~dotdeb.0
Set-Cookie: ZDEDebuggerPresent=php,phtml,php3; path=/ PHPSESSID=625qvi6328pdq2t7psh4t3voi6; path=/ PHPSESSID=625qvi6328pdq2t7psh4t3voi6; path=/ PHPSESSID=625qvi6328pdq2t7psh4t3voi6; path=/
Cache-Control: no-cache
x-debug-token: 9dcc688323f1dad273d4c8fc7117f405a52ce998
Vary: Accept-Encoding
Content-Encoding: gzip
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=ISO-8859-1
如您所见,共有三个 PHPSESSID。
我尝试使用带有三个 session_start(); 调用的单个文件来重现此行为:
<?php
session_start();
session_start();
session_start();
但 cookie 只发送一次。
知道这是怎么发生的吗?
【问题讨论】:
标签: php session-cookies