PHP Validation Session Invalid problem solving method

Source: Internet
Author: User
Tags exit php file

Environment, I'm using the apache+php environment.

If my program code is as follows

The code is as follows

<input name= "username" type= "text" class= "input" id= "username" >
<input name= "password" type= "password" class= "input" id= "password" >
<input name= "ver" type= "text" class= "input1" id= "ver" size= "5" >

Processing files After submitting this post.php file

if ($_session[' Ssioner ']!= $ssever) {
Echo (' <script>alert (' captcha must consist of 4 digits! '); History.back ();</script> "); exit;
}

It turns out that the verification code must be 4 digits, and I'll print out the session

echo $_session[' Ssioner '];exit;

has been empty, when I thought of the PHP environment configuration of a session file directory, now we find the php.ini configuration file to find

Upload_tmp_dir

Found this directory is

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

I check my d disk found only www.111cn.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 files, The login was successful again.

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.