Solution to the problem of invalid PHP session verification_PHP tutorial

WBOY
Release: 2016-07-13 10:18:18
Original
1237 people have browsed it

Solution to the invalid php session verification problem

Environment, I am using the apache+php environment

For example, my program code is as follows

The code is as follows




 代码如下  




提交之后处理文件这post.php文件

if($_SESSION['ssioner']!=$ssever){
echo("<script>alert('验证码必须由4位数字组成!');history.back();</script>");exit;  
}

Process the file after submitting this post.php File

if($_SESSION['ssioner' ]!=$ssever){
echo("<script>alert('The verification code must consist of 4 digits!');history.back();</script>");exit;
}

It turns out that it keeps prompting that the verification code must consist of 4 digits, so I print out the session

echo $_SESSION['ssioner'];exit;

It has been empty, so I thought of a session file directory in the php environment configuration. Now we find the php.ini configuration file and find

upload_tmp_dir

Found this directory is

upload_tmp_dir="D:www.111cn.nettp"

I checked my D drive and found that there was only the www.111cn.net file but no tp directory, so the problem was found. Then I created a tp directory, restarted apache and found that there was the sess_i40gl0p4hfep5r69j67o1k26d01 file in the tp directory, so Logged in again and found success.

http://www.bkjia.com/PHPjc/884224.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/884224.htmlTechArticle
php verification session invalid problem solution environment, I use the apache+php environment. For example, my program code is as follows The code is as follows input name=username type=text class=input id=username inp...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!