Search code examples
phpsessioncookiessession-statesession-cookies

What is the difference between Sessions and Cookies in PHP?


What is the distinction between Sessions and Cookies in PHP?


Solution

  • 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)