我的php会话只能在Google Chrome中工作。 每隔一个浏览器,它们就不会出现。 有谁知道为什么?这是我第一页的代码...
<?php
// this starts the session
session_start();
// this sets variables in the session
$_SESSION['color']='red';
$_SESSION['size']='small';
$_SESSION['shape']='round';
print "Done";
?>
这是我第二页的代码...
<?php
// this starts the session
session_start();
// echo variable from the session, we set this on our other page
echo "Our color value is ".$_SESSION['color'];
echo "Our size value is ".$_SESSION['size'];
echo "Our shape value is ".$_SESSION['shape'];
?>
在第二页上,它不会在Chrome以外的任何浏览器中显示会话变量。 有谁知道如何解决这个问题?
也许您的测试浏览器上未启用 cookie,或者安全级别设置得太高(对于 IE)。
尝试启用它们,以确保它们设置正确。