PHP Session Variables Not Saved in Centos Linux?

无人久伴 提交于 2019-12-11 08:24:16

问题


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.

来源:https://stackoverflow.com/questions/8844306/php-session-variables-not-saved-in-centos-linux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!