Solution for space session failure: session failure

Source: Internet
Author: User

Solution for space session failure: session failure

When I visited my website today (by thinkphp), I suddenly found that my identity verification failed, the Session could not be cross-page, and a verification code error was always prompted during login (the verification code was also passed through the Session ), to realize that the Session may be invalid. Because the space I rented is in the IIS environment, sessions may be stored in a fixed location, which is transparent to me (unknown ), it may have a problem (full or permission problem), so I decided to modify the location where the Session is stored and found the following solution on the Internet to finally solve the problem:

There are many different methods to modify the session path, such as modifying the session path directly in the tp configuration file or modifying the session path in php. ini. Let's take a look at it.

Modifying sessions in TP is quite simple, and TP is also taken into account for us!

You only need to add the following in the project configuration file:

'Session _ options' => array ('path' => 'd:/thinkphp/sessions /')


You can also modify the configuration session. save_path in php. ini to comment out the settings. In this case, where is the path stored by Seesion stored in different operating systems?

Linux:

/Tmp or/var/lib/php/session

Windows:

C:/WINDOWS/Temp

 

It is expected to help children's shoes with the same problems.

Source: http://www.dqiu.net/doc/57e0a85100552

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.