PHP background site exit with Session_destroy () The Session object destruction failed error resolution

Source: Internet
Author: User
        Session_unset (); Session_destroy (); echo "<script language=javascript>parent.location.href= ' Admin_Login.php ' </script> ";

With this command, always out of the background, hint Session_destroy () failed, encountered this problem, has been thought to be a PHP version of the problem, so has not cared, today want to solve this problem thoroughly, so the study was found that the original is not a PHP version of the problem, It is the permissions of the file that holds the session.

Let's take a look at the php.ini file with this configuration:

Session.save_path = "D:/host/php/temp"

This configuration is used to set the location of the session variable, it is amazing, the session also like a cookie, is stored as a file on the server.

And with Session_destroy (), the command is to put the following stored in the session file inside the variable is deleted, if the permissions of this folder is not enough to operate.

So you need to set the permissions of this temp folder.

Adding a users permission to this file is OK.

PHP background site exit with Session_destroy () The Session object destruction failed error resolution

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.