What is the difference between a session ID and a cookie ID?

The session id is synonymous with the 'cookieid' that you see appended to all links on your pages. The system creates a record in a database know as the 'session' file. Each unique visitor gets a session and session id. We use this record in the database to track their movement throughout the site. If a user has their cookies turned off, subsequent visits will create a new record and session id. If cookies are on, the system will use the same record over and over.

The purpose of the 'cookie' is to maintain 'state' throughout the users visit to your site.  The web is a 'stateless' environment whereby each request for a webpage opens and closes a connection on each click.  Your windows pc is not 'stateless' as it always knows who is logged in and what is happening.  The web was originally designed to transfer documents for the military in an anonymous fashion, hence, the design does not lend itself well to monitoring individual users.

Without cookies and sessions, users would lose their shopping carts each time they tried to add a new item to the cart.


Was this answer helpful? 157 Users Found This Useful (371 Votes)