Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
what is the difference between session and state?
Posted
Comments
vangapally Naveen Kumar 27-Jun-12 7:54am    
did you mean difference between application state and application session ha?
Sergey Alexandrovich Kryukov 27-Jun-12 13:02pm    
Same as the difference between Titanic and navigation. :-)
Such questions cannot be correct.
--SA

Since you are asking about ASP.NET, I'm going to assume you are talking about sessions and session state.

The HTTP protocol is stateless, meaning that it treats each request as independent, without knowledge of the previous calls to the server. A session is designated as a short period of time that the server defines where calls from the same machine will be treated being part of the same set of calls. This is a session. You can define how long a session is and what criteria will end the session.

During this session, variables and other information can be collected and used to give the user the appearance that their changes are making changes to the system (even though these changes are usually temporary). This is session state. It is the state the session is in.

This is why session and state aren't really two topics but one topic. Here is a link with more information:

http://msdn.microsoft.com/en-us/library/ms178581.aspx[^]
 
Share this answer
 
difference between session and state
Session is one of the ways to maintain the state.


A new instance of the Web page class is created each time the page is posted to the server. In traditional Web programming, this would typically mean that all information associated with the page and the controls on the page would be lost with each round trip. For example, if a user enters information into a text box, that information would be lost in the round trip from the browser or client device to the server. To overcome this inherent limitation of traditional Web programming, ASP.NET includes several options that help you preserve data on both a per-page basis and an application-wide basis. - Session is one of the techniques.

Refer: MSDN: ASP.NET State Management Overview[^]
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 27-Jun-12 13:03pm    
5ed.
Incorrect question though.
--SA
Sandeep Mewara 27-Jun-12 14:28pm    
Thanks Sergey.

Yeah wrong comparison it is.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900