Sessions VS Cookies in ASP

What is the difference between storing a session variable and storing a cookie? In this article I will give you a quick insight between a Session and a Cookie.


Sessions are stored by the user in memory on the server. Sessions use a cookie “session key” to attach a user to the session. This means no sensitive data is stored in the cookie on the user machine.

Sessions are generally used to maintain state when you navigate through a website. However, they can also be used to hold commonly accessed objects.



Cookies are stored by the user on the user’s machine. A cookie is most use for small information. Cookies are usually used for simple user. No sensitive information be stored in a cookie.

A user can clear this cookies at any time or not allow cookies all together so you cannot trust on them being there just because a user has visited your site in the past.


This concludes Sessions Vs. Cookies

Looking for quality Windows Hosting? Look no further than Arvixe Web Hosting!

Happy Hosting!

Rodolfo Hernandez

Tags: , , , , , , , , , , , , | Posted under ASP .NET 2, ASP .NET 4.0, WebsitePanel Tutorials | RSS 2.0

Author Spotlight

Rodolfo Hernandez

I like photography and reading books. Currently working for Arvixe as Elgg Community Liaison. Elgg Security Expert Web Security Expert CEO of UDP SW Social Web

Leave a Reply

Your email address will not be published. Required fields are marked *