When to start a session?

后端 未结 6 1633
你的背包
你的背包 2021-01-16 14:28

I have a system that requires the user to login (or register) for an account before they are able to access their Member \'dashboard\'.

My question is... at what poi

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-16 15:04

    As Helge Helwig said,

    you need to add session_start() in the top of every page. However, to make this easier, you can create a PHP document, where you store all vital code like this, and call it; say init.php.

    Then you can include 'init.php' at the top of every page, which would clean up the code a bit.

提交回复
热议问题