Cookies: Cookies also used to maintain the state at client site(that means at browser). Cookie is a small text file that is stored on client browser.

There are two types of cookies.
1) Persistent Cookies
2) Non Persistent Cookies
Persistent Cookies are called as permanent cookies, which is stored in client hard-drive until it expires . persistent cookies should have set with expiration dates. Sometimes its stays until the user deletes the cookie. Persistent cookies are used to collect identifying information about the user from that system.

Non Persistent Cookies are called as Temporary Cookies. If there is no expires time defined then the cookie is stored in browser memory .

Serverside State Management:
Server side state management means storing the values in the server.

There are two types of server side state management.
1) Application
2) Session

Application:
ASP.NET implements application state using the System.Web.HttpApplicationState class. It provides methods for storing information which can be accessed globally. Information stored on application state will be available for all the users using the website.
E.g Application(“id”) = 1024
Session:
A cookie is very simple and is not suitable for secure storage requirements. Session state is a workaround for this problem and it gives a method to keep more complex objects securely. ASP.NET allows programmers to keep any type of objects in session. Data stored in session will be kept in server memory and it is protected as it will never get transferred to the client

E.g. Session(“userid”)=1024

By using Session.Abandon() we can kill the session.
By using Session.clear() we can clear the content in session
By using Session.Remove(“name”) we can remove the particular session by passing the name.


<< Previous

Recent Articles

CLR integartion in SQL Server
Create, Read and Write Files in .Net
Message Queue in .Net
Deploy Asp.Net Web Site
Queues in Vb.Net
If you have any queries or doubts post at Forum
Share on Facebook
Responses(post your response or comments below)
Name *

Email * (won't be published)

Response *