Monday, February 22, 2010

Difference between Session object and Application object in asp.Net

Session variables are used to store user specific information where as in application variables we can't store user specific information.

Default lifetime of the session variable is 20 mins and based on the requirement we can change it.

Application variables are accessible till the application ends.
sessions allows information to be stored in one page and accessed in another,and it supports any type of object,including your own custom data types.

Application state allows you to store global objects that can be accessed by any client.

The coomon thing b/w session and application is both support the same type of objects,retain information on the server, and uses the same dictionary -based syntax.


  1. application object the id is maintained for whole doesn't differ
    the session object is used to maintain the session of each user. If one user enter in to the application then they get seesion id if he leaves from the application then the session id is deleted.If they again enter in to the application they get different session id.


Locations of visitors to this page