ITP

BSc IT - Web Application Development - ASP.NET

Difference between cookies and session.

In : BSc IT Subject : Web Application Development - ASP.NET

Cookies and Session are both used to store user-specific data in web applications, but they work differently.

Cookies  are small text files stored on the user's browser (client-side) that can persist even after the browser is closed, depending on their expiration settings. They are often used to remember user preferences, such as language or login status, but are less secure because users can view or modify them.

On the other hand, Session  stores data on the server and only keeps a session ID in a cookie on the client side. This makes sessions more secure and reliable for storing sensitive information like user login details or shopping cart items. However, session data is temporary and is lost when the user closes the browser or the session times out. In summary, cookies are lightweight and client-based, while sessions are server-based, secure, and ideal for short-term storage during a user’s visit.

About us

A truly open platform where you may ask questions and get answers. We also provide comprehensive and easy-to-understand answers to question papers.  discover...

Site status

Flag Counter

Privacy Policy

Sitemap