Do PHP sessions set any cookies?

后端 未结 4 1437
离开以前
离开以前 2020-12-09 11:50

I only manually set one cookie on my social network site, but I rely heavily on php sessions. I am wondering if sessions set any cookies behind the scenes?

I was jus

4条回答
  •  执笔经年
    2020-12-09 12:42

    PHP sessions can use cookies depending on how you configure them. Have a look at these settings:

    • session.use_cookies (boolean): specifies whether the module will use cookies to store the session id on the client side. Defaults to 1 (enabled).
    • session.use_only_cookies (boolean): specifies whether the module will only use cookies to store the session id on the client side. Enabling this setting prevents attacks involved passing session ids in URLs. This setting was added in PHP 4.3.0. Defaults to 1 (enabled) since PHP 5.3.0.

    If you disable session cookies, a GET parameter is used instead.

提交回复
热议问题