Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > lifetime of Session and Application ???

Reply
Thread Tools

lifetime of Session and Application ???

 
 
Chris
Guest
Posts: n/a
 
      06-03-2010
Hello.

Lifetime of Session-data is specified in web.config.

But what about Application-data?

I have a little testWebApp in which Session-timeout is set to 1 minute

Application["AppData"] = 1;
Session["SessionData"] = 2;

lblAppData.Text = Application["AppData"] != null ?
Application["AppData"]: "Expired"
lblSessionData.Text = Session["SessionData"] != null ?
Session["SessionData"]: "Expired"

refreshing the page after more than 1 minute displays "Expired" for
Session but keeps on showing the Application-data.

So, what determines the lifetime of Application-data?

thx
Chris


 
Reply With Quote
 
 
 
 
Nick Gilbert
Guest
Posts: n/a
 
      06-04-2010

On 03/06/2010 16:53, Chris wrote:
> Hello.
>
> Lifetime of Session-data is specified in web.config.
>
> But what about Application-data?
>
> I have a little testWebApp in which Session-timeout is set to 1 minute
>
> Application["AppData"] = 1;
> Session["SessionData"] = 2;
>
> lblAppData.Text = Application["AppData"] != null ?
> Application["AppData"]: "Expired"
> lblSessionData.Text = Session["SessionData"] != null ?
> Session["SessionData"]: "Expired"
>
> refreshing the page after more than 1 minute displays "Expired" for
> Session but keeps on showing the Application-data.
>
> So, what determines the lifetime of Application-data?


Application data only expires if IIS is restarted, or the application
pool it's hosted in is recycled. This can happen if the website is not
accessed for a long time, or if a worker process crashes or is recycled
by IIS due to it using too much RAM. Application variables should not be
treated as a permanent data store and your application should be able to
cope with the Application variables disappearing at any time.

Nick.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Session Timeout problems-web.confg session state and IIS session s =?Utf-8?B?Um9iSEs=?= ASP .Net 4 04-11-2007 04:52 PM
ASP.NET Application Lifetime & Cache Expiration Sashko ASP .Net 1 06-22-2006 06:24 PM
lifetime of Session object Colin Basterfield ASP .Net 2 06-03-2004 03:14 AM
What is the lifetime of an Application state? Bruce W.1 ASP .Net 1 01-29-2004 07:29 PM
Application object lifetime Paolo Pagano ASP .Net Web Services 0 07-22-2003 10:05 AM



Advertisments