After moving from the test environment to the formal environment, the session has no value.

Source: Internet
Author: User
After moving from the test environment to the formal environment, the session has no value and a logon page is created. different la s are displayed at the top of the page based on the logon status. After logging on to the system before login, the results of the Test environment are displayed based on the session value, and the operation is normal. However, after I moved to the official environment, after logging in, I still displayed the first image, login and registration. After I move the implementation method from the test environment to the formal environment, the session has no value.
On the login page, different la s are displayed at the top of the page based on the login status.
Before login

After login, the session value is displayed

This is the effect of the test environment, and there is no problem with running.
However, after I moved to the official environment, after logging in, I still displayed the first image, login and registration.

In reality, php is embedded in header.html to determine how to output html code based on the value of session ['username.
The session value is in the login interface, that is, login. php.


If (isset ($ _ SESSION ['username'])
{
Echo "";
Echo"
  • My account
  • ";
    Echo"
  • Exit
";
Echo "log on to". $ _ SESSION ['username']. "";
}
Else
{
Echo "";
Echo"
  • Login
  • ";
    Echo"
  • Register
";
}

?>


Note: the test environment is XP, and the official environment is server03. share:
------ Solution --------------------
Session_start ();

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.