Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I m umesh.I want to know that what is actual diff between application and session state in asp.net.
pls give me some demo.
Posted
Updated 9-Aug-17 5:13am
v2

You don't need a demo, you need to do research... MSDN[^]
 
Share this answer
 
Comments
Shahriar Iqbal Chowdhury/Galib 29-May-12 4:06am    
Good reference , my 5
Application state will be available to all users of the application when set
Basically user A sets application variable "AppID" to "myApp"
User B retrieves application variable "AppID" and reads "myApp"



Session state will only be available to a specific user of the ASP.net application

User A sets session variable "UserID" to "2"
User B loads the session variable "UserID" and receives null
User A loads the session variable "UserID" and receives "2"
 
Share this answer
 
Comments
anbujeremiah 2-May-13 22:32pm    
can u please explain / give example for User A , User B
The main difference is that application is common for the whole application and session is different for different user,other wise both are same

C#
Application["samp"] = "something";
Session["samp"] = "something";
 
Share this answer
 
v2
Quick'n'dirty answer:

Application State has scope throughout the application whilst Session State only has scope within the current session.
 
Share this answer
 
Session state is unique to the client

where as

Application state is sharable among the clients
 
Share this answer
 
Session variable are only available at the user level means no user can access the other user session variables.


Application variable is available at application level means every user of the application can access the same application variable.
 
Share this answer
 
i am giving you a link it will give you brief idea of caching concept

Exploring Session in ASP.NET[^]

best of luck!
 
Share this answer
 

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