大家好!我有一個關於會議的問題,希望有人能幫助我。我有一個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