PHP to determine whether the user session is related to the problem, put before <html> does not work

Source: Internet
Author: User
PHP Determines if there is a problem with the user session, and does not work before
]
 
  require_once (' config.php ');

Determine user permissions
if ($_session[' member '! = "admin") {
echo "";
}
?>


It doesn't work before, put it inside, Firefox makes a judgment, but IE still doesn't work php?session? Firefox PHP session

Share to:


------Solution--------------------
Add a session_start () to the top of the page;
------Solution--------------------
Session and Cookie are brothers.

Session_Start () is to initialize the session information (in a certain probability to delete the existence of the server session file, the probability can be set in php.ini).

There is no need to session_start () can also access session information: is because your cookie is still there. Then the session file on the server is still there. So you can read it.

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