问题描述:

this is a section of my script:

session_start();

echo '<p>Initiated...';

if (isset($_POST['submit'])) {

echo '<p>Executed...';

if ($_POST['username'] == $un && $pw == md5($_POST['password'])) {

$_SESSION['user'] = 'admin';

echo '<p>Success...';

$value = 'admin';

setcookie("user2", $value);

setcookie("user2", $value, time()+36000); /* expire in 1000 hours */

setcookie("user2", $value, time()+36000, "/", "my.domain.net", 1);

echo 'Hello!'.$_COOKIE["user2"];

echo $HTTP_COOKIE_VARS["user2"];

}

}

It works perfectly in FireFox, Chrome and Safari, however it will not work in Internet Explorer as it does not seem to be setting cookies. The output in Internet Explorer is:

Initiated...

Executed...

Success...Hello!

In Chrome/Safari/FireFox:

Initiated...

Executed...

Success...Hello!admin

Settings in Internet Explorer are set to accept all cookies .. I'm really stuck on this. :( please help.

网友答案:

Try adding the following after the session_start()

header('P3P: CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"');
网友答案:

Can you upload the Headers returned form your PHP code? (Fiddler or something similar can help you)

相关阅读:
Top