- 論壇徽章:
- 0
|
環(huán)境:
客戶端:IE7,接受所有cookie
服務(wù)器端: apache 2.2.6, mysql 5.0.45, php 5.2.4
如下的簡(jiǎn)單php腳本
<?php
session_start();
if (isset($_SESSION['test_sess'])){
$_SESSION['test_sess']++;
}else{
$_SESSION['test_sess'] = 0;
}
echo $_SESSION['test_sess'];
?>
在firefox中,運(yùn)行正常,數(shù)字不停遞增。
在IE7中,數(shù)字始終為零
http 抓包分析。
apache的http response中,有set-cookie字頭
HTTP/1.1 200 OK
Date: Thu, 28 Feb 2008 04:14:45 GMT
Server: Apache/2.2.6 (Fedora)
X-Powered-By: PHP/5.2.4
Set-Cookie: PHPSESSID=704c9eg9m5bsge8qcjq8a4uiu0; path=/
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
Content-Length: 1
Connection: close
Content-Type: text/html; charset=UTF-8
但是,IE的下一個(gè)http request中沒(méi)有cookie字頭
GET /test.php HTTP/1.1
Accept: */*
Accept-Language: zh-cn
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)
Host: download_server
Connection: Keep-Alive
似乎IE7對(duì)set-cookie沒(méi)有響應(yīng),但是IE7的cookie確實(shí)已經(jīng)打開(kāi)了。
請(qǐng)問(wèn)到底是什么地方不對(duì)?是不是IE7對(duì)PHP的Session的兼容問(wèn)題?還是apache,php.ini的配置問(wèn)題? |
|