What is the difference between Sessions and Cookies in PHP?

Harsh picture Harsh · Jun 14, 2011 · Viewed 201.8k times · Source

What is the distinction between Sessions and Cookies in PHP?

Answer

Quentin picture Quentin · Jun 14, 2011

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)