PHP Validation Session Invalid workaround, PHP validation session
This article describes a workaround for PHP to verify that the session is invalid. Share to everyone for your reference. Here's how:
First, the question
Today in the configuration of apache+php environment for a long time, and then succeeded but found that the verification code picture can be generated, in the login verification found that the session is empty, and there is no value.
Second, the solution
Environment: apache+php
The program code is as follows:
Copy the Code code as follows:
Processing files After submission this post.php file
Copy the Code code as follows: if ($_session[' Ssioner ']!= $ssever) {
Echo (""); exit;
}
It is found that the verification code must be composed of 4 digits, and then print out the session:
Copy the Code code as follows:
echo $_session[' Ssioner '];
Exit
Always empty, when I think of the PHP environment configuration of a session file directory, now we find the php.ini configuration file found
Upload_tmp_dir
Find this directory is
Upload_tmp_dir= "D:\WWW.JB51.NET\TP"
I check my d disk found only www.jb51.net file and no TP directory, so the problem is found, when I create a TP directory, restart Apache found in the TP directory has sess_i40gl0p4hfep5r69j67o1k26d01 file, This re-login has been successfully found.
I hope this article is helpful to everyone's PHP programming.
How is PHP session invalid??
Session_Start ();
if (isset ($_post[' name ')) {
$_session[' name ']= ' test ';
}
Print $_session[' name '];
?>
In the
A workaround for the session verification code and display delay in PHP
First you can debug in your project and print out your captcha information in the class. If it matches the verification code shown on the page, the general situation is not a problem. Unless you've loaded it multiple times when you refer to it.
I have previously written a verification code function, you can refer to: Baidu PHP verification Code Pooy. I can find the article I wrote before.
http://www.bkjia.com/PHPjc/906116.html www.bkjia.com true http://www.bkjia.com/PHPjc/906116.html techarticle PHP validation session Invalid resolution, PHP validation session This article describes the PHP validation session Invalid resolution method. Share to everyone for your reference. The concrete method is as follows: First, ask ...