我做了一个session跨页面传递信息的测试页面。
在a.php里面向session中写入信息,在b.php里面读取a中写入的信息。但是现在看不到。
大家帮忙看看是什么地方配置的问题么?多谢了!
linux服务器 php5.编译选型如下
'./configure' '--prefix=/usr/local/php' '--with-apxs2=/usr/apache2/bin/apxs' '--with-mysql=/usr/local/mysql/' '--with-mysqli=/usr/local/mysql/bin/mysql_config' '--with-zlib=/usr/local' '--with-gd=/usr/local' '--with-freetype-dir=/usr/local' '--enable-shmop' '--enable-sysvmsg'
a.php
<?php
session_start();
$_SESSION["channel"]="aaaaaa";
printf("sessionid:%s channel:%s",session_id(),$_SESSION["channel"]);
print_r($_SESSION);
?>
<br/>
<a href="session_b.php" target="_blank">b.php</a>b.php
<?php
session_start();
printf("sessionid:%s channel:%s",session_id(),$_SESSION["channel"]);
print_r($_SESSION);
?>phpinfo()中session的显示如下。
session
Session Support         enabled
Registered save handlers         files user sqlite
Registered serializer handlers         php php_binaryDirective        Local Value        Master Value
session.auto_start        Off        Off
session.bug_compat_42        Off        Off
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        Off        Off
session.entropy_file        no value        no value
session.entropy_length        0        0
session.gc_divisor        1000        1000
session.gc_maxlifetime        1440        1440
session.gc_probability        1        1
session.hash_bits_per_character        5        5
session.hash_function        0        0
session.name        PHPSESSID        PHPSESSID
session.referer_check        no value        no value
session.save_handler        files        files
session.save_path        /var/lib/php/session        /var/lib/php/session
session.serialize_handler        php        php
session.use_cookies        On        On
session.use_only_cookies        Off        Off
session.use_trans_sid        0        0