A cookie is one means of tracking customer data, which can be useful for a variety of reasons, like cart-tracking or personlization of the webpage. The main problem with cookies is that they can be blocked or disabled by the user, making them useless. Otherwise, they are sent to the server where they can be processed and used to send back specific information to the client.
A session is the time span during which a browser interacts with particular server. A session begins when a browser connects to the server and ends when either the browser is closed or the server terminates the session due to inactivity (usually default is something like 30min).
- Similarities with cookies:
- - Hold information about one single user
- - Pass information from one page to another in your application
- Differences from cookies:
- - Store the information at the server side instead of the client side
- - Session information is deleted after the user has left the website (although permanent storage is possible)