What is the difference between Sessions and Cookies in PHP?

前端 未结 8 1852
无人及你
无人及你 2020-11-28 04:51

What is the distinction between Sessions and Cookies in PHP?

相关标签:
8条回答
  • 2020-11-28 05:16

    One part missing in all these explanations is how are Cookies and Session linked- By SessionID cookie. Cookie goes back and forth between client and server - the server links the user (and its session) by session ID portion of the cookie. You can send SessionID via url also (not the best best practice) - in case cookies are disabled by client.

    Did I get this right?

    0 讨论(0)
  • 2020-11-28 05:19

    A cookie is a bit of data stored by the browser and sent to the server with every request.

    A session is a collection of data stored on the server and associated with a given user (usually via a cookie containing an id code)

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