PHP session_start()

后端 未结 5 1683
眼角桃花
眼角桃花 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:18

    PHP's session_start starts OR resumes an HTTP session, which is explained fairly well in this article:

    http://en.wikipedia.org/wiki/Session_(computer_science)

    The concept of an HTTP "session" isn't specific to PHP, it's used in many (all?) server side HTTP frameworks as one way to allow for some state to be stored/associated across different request/responses (since HTTP is stateless). A unique token (which is often, but not always, stored in a cookie) identifies a particular client, and the server can associate the "session."

    Here's some more info about sessions and PHP in particular that may help: http://www.php.net/manual/en/book.session.php

提交回复
热议问题