我遇到了大麻烦。会话变量不适用于PHP和Apache 2.我已经尝试了很多东西。但我没有更多的想法。请帮助!
test1.php
<?php
session_start();
ini_set('session.cookie_domain', 'www.domain.com');
echo "test1.php";
$_SESSION['VAR1'] = 'My Value';
header('location:test2.php');
session_write_close();
exit();
?>
test2.php
<?php
session_start();
ini_set('session.cookie_domain', 'www.domain.com');
echo "test2.php <br />";
echo 'VAR 1 = '.$_SESSION['VAR1'];
?>
返回
test2.php
VAR 1 =
环境
PHP Version 5.3.10-1ubuntu3.19
Server API Apache 2.0 Handler
session.auto_start On
session.cookie_domain no value
session.cookie_httponly On
session.cookie_lifetime 0
session.save_path /var/lib/php5/
session.serialize_handler php
session.use_cookies On
session.use_only_cookies On
我尝试过的事情
谢谢!