douchao9899 2012-01-13 00:20
浏览 64

Centos Linux中没有保存PHP会话变量?

I am having this PHP script that fails to save the session variable when I hit submit in my PHP Version 5.1.6 linux centos system. This problem happens over time. Currently I temporary solve this problem with PHP by rebooting the machine. However, this is not a good solution. It is just a temporary solution.

Here is PHP Session info:

Directive   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_lifetime 0   0
session.cookie_path /   / 
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

Under PHP core:

Directive   Local Value Master Value
open_basedir    /var/www/domain.com/httpdocs/public_html/:/tmp/ no value

I would like anyone to suggest why rebooting the machine solves the temporary PHP session variables not saved.

My PHP code uses session variable to check if the captcha values are solved properly when I hit submit button. This check shown below is done when the page reloads after submit is hit.

<?php
session_start();

if($_SESSION['captcha_keystring'] == $_POST["keystring"]){


} // End: if capcha verification


else
{
        echo "Wrong Capcha Entered!";
}

?>

Even when this is captcha_keystring is solved properly this fails.

  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
    • ¥50 有数据,怎么用matlab求全要素生产率
    • ¥15 TI的insta-spin例程
    • ¥15 完成下列问题完成下列问题
    • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
    • ¥15 YoloV5 第三方库的版本对照问题
    • ¥15 请完成下列相关问题!
    • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
    • ¥15 求daily translation(DT)偏差订正方法的代码
    • ¥15 js调用html页面需要隐藏某个按钮