PHP Session not Saving

前端 未结 9 1103
情话喂你
情话喂你 2020-12-03 17:39

I have this written at the very first line on every page of my website.

include(\"restd.php\");

and restd.php contains the following lines

9条回答
  •  佛祖请我去吃肉
    2020-12-03 17:56

    Do you actually set $_SESSION['id'] on a page...

    What you are trying to do here is:

    1. Start a session and load the $_SESSION from the session handler
    2. Check if $_SESSION contains key 'id'
    3. Redirect to index.php if $_SESSION['id'] is not set

    Do you actually do this in index.php?

    session_start();
    $_SESSION['id'] = something;
    

提交回复
热议问题