PHP session_start()

后端 未结 5 1660
眼角桃花
眼角桃花 2020-11-29 03:42

What is this really?

Does it start a current session based on cookies? Got that from the PHP website. How does PHP control the session? If I start a session when a

5条回答
  •  遥遥无期
    2020-11-29 04:11

    Like it says in the Manual

    session_start() creates a session or resumes the current one based on a session identifier passed via a GET or POST request, or passed via a cookie.

    If you start a new session at your login page, the session is initially empty. You can store in it whatever you want, for instance, store the user id once the user has logged in. The session data is destroyed when you close the session.

    You might want to read all chapters in the Session Extension Manual Pages and also see

    • what is session and cookies in php and where it stored

提交回复
热议问题