The main difference between cookies and sessions is that cookies are stored in the user's browser, and sessions are not.
A session is available as long as the browser is opened while A cookie can keep information in the user's browser until deleted.
User can block cookies or delete them at any time while Sessions are not reliant on the user allowing a cookie. They work instead like a token allowing access and passing information while the user has their browser open.
Anonymous User
11-Oct-2010The main difference between cookies and sessions is that cookies are stored in the user's browser, and sessions are not.
A session is available as long as the browser is opened while A cookie can keep information in the user's browser until deleted.
User can block cookies or delete them at any time while Sessions are not reliant on the user allowing a cookie. They work instead like a token allowing access and passing information while the user has their browser open.
For creating cookies you can read this link.
http://www.mindstick.com/Articles/c4e253f5-67dc-4211-8a1f-e29c17ce2943/
For details about creating and using Session visit this link.
http://www.mindstick.com/Articles/273b0c21-a027-46ec-8c84-ad4e05c62b23/