PHP Validation Session Invalid workaround, PHP validation session_php tutorial

Source: Internet
Author: User
Tags php session

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 ...

  • 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.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.