What is PHPSESSID?

后端 未结 5 1168
遇见更好的自我
遇见更好的自我 2020-12-01 04:58

I\'m playing around with cookies. And I dont have any cookies called PHPSESSID.

Do i need it? Can i remove it?

Whats the \"function\" of it?

         


        
相关标签:
5条回答
  • 2020-12-01 05:26

    Check php.ini for auto session id.

    If you enable it, you will have PHPSESSID in your cookies.

    0 讨论(0)
  • 2020-12-01 05:29

    PHP uses one of two methods to keep track of sessions. If cookies are enabled, like in your case, it uses them.

    If cookies are disabled, it uses the URL. Although this can be done securely, it's harder and it often, well, isn't. See, e.g., session fixation.

    Search for it, you will get lots of SEO advice. The conventional wisdom is that you should use the cookies, but php will keep track of the session either way.

    0 讨论(0)
  • 2020-12-01 05:31

    PHPSESSID is an auto generated session cookie by the server which contains a random long number which is given out by the server itself

    0 讨论(0)
  • 2020-12-01 05:35

    PHPSESSID reveals you are using PHP. If you don't want this you can easily change the name using the session.name in your php.ini file or using the session_name() function.

    0 讨论(0)
  • 2020-12-01 05:46

    It's the identifier for your current session in PHP. If you delete it, you won't be able to access/make use of session variables. I'd suggest you keep it.

    0 讨论(0)
提交回复
热议问题