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.