php session doesn't work

前端 未结 8 517
余生分开走
余生分开走 2021-01-22 18:57

How it should work: Index.php is the secured page. It includes check.php, which checks if you have a session = good. If it hasn\'t, you\'re not logged in -> log off, remove sess

8条回答
  •  温柔的废话
    2021-01-22 19:24

    First check on the pages you want to use session variables session is start or not and if session is not stat then start it.

    and this is the very first line in the php file.

    Code for the session checking is :

    if(!session_id())
    {
        session_start();
    }
    

提交回复
热议问题