A session is a piece of temporary information interchanged between two or more communicating devices, or between a computer and user. It is established at a certain time and then expires at a future time. It also expires when the user closes the browser or when leaving a website. When a session is established, a file is created in a temporary directory (or in a database or the server memory) on the server to store the registered session values. This data is then available throughout the website during the visit, and the browser receives a session ID, which is to be sent back, either by a cookie or by the GET variable, to the server for validation.
In short, cookies and sessions are just data. Cookies are only stored on the client-side machine, while sessions get stored on the client as well as on the server. Sessions are considered more secure than cookies because the data can be kept solely on the server. Cookies are often created when the session is established...