大家好!我有一个关于会议的问题,希望有人能帮助我。我有一个apache测试服务器,它使用http和https的虚拟主机。我把下面的文件在我的HTTPS和它的工作原理:虚拟主机会话问题
mytest.php:
// this starts the session
session_start();
// this sets variables in the session
$_SESSION['color']='red';
$_SESSION['size'] ='small';
$_SESSION['shape']='round';
echo "Done";
mytest2.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'];
但它并不当我查看复制工作HTTP。
phpinfo()函数中都是相同的:
session
Session Support enabled
Registered save handlers files user sqlite
Registered serializer handlers php php_binary wddx
Directive Local Value Master Value
session.auto_start Off Off
session.bug_compat_42 On On
session.bug_compat_warn On On
session.cache_expire 180 180
session.cache_limiter nocache nocache
session.cookie_domain no value no value
session.cookie_httponly Off Off
session.cookie_lifetime 0 0
session.cookie_path//
session.cookie_secure On On
session.entropy_file no value no value
session.entropy_length 0 0
session.gc_divisor 100 100
session.gc_maxlifetime 1440 1440
session.gc_probability 1 1
session.hash_bits_per_character 4 4
session.hash_function 0 0
session.name PHPSESSID PHPSESSID
session.referer_check no value no value
session.save_handler files files
session.save_path /tmp /tmp
session.serialize_handler php php
session.use_cookies On On
session.use_only_cookies Off Off
session.use_trans_sid 0 1
“当我在http中查看副本时,它不起作用。”你能更具体一点吗?这两个脚本在不同的领域? – 2010-07-13 17:21:57
没有。我使用的是http://192.168.1.101/mytest.php和http://192.168.1.101/mytest2.php,以及https://192.168.1.101/mytest.php和https://192.168.1.101/mytest2。 php – Lucas 2010-07-13 17:23:36
你正在从http连接到https吗?尝试打印sessionid()以查看切换页面时会话ID是否更改... – 2010-07-13 17:23:36