asp.net - Session variable getting lost? -


given global.asax.cs:

using system; using system.web;  namespace foo.web {     public class global : httpapplication {         private const string introductionpageshownsessionkey = "introductionpageshownsessionkey";          protected void application_acquirerequeststate(object sender, eventargs e) {             showintroductionifnotyetshown();         }          private void showintroductionifnotyetshown() {             if (httpcontext.current.session != null) {                 var introductionpageshown = convert.toboolean(session[introductionpageshownsessionkey]);                 if (!introductionpageshown) {                     if (request.path.endswith("/introduction.aspx")) {                         session[introductionpageshownsessionkey] = true;                     }                     else {                         response.redirect("~/introduction.aspx" + request.url.query);                     }                 }             }         }     } } 
  1. user hits webapp , shown introduction.aspx
  2. user continues using webapp few minutes (asp.net_sessionid: ublbhu45ji31e055ywqu0555)
  3. user falls idle (doesn't perform postbacks) few minutes
  4. user performs postback
  5. user shown introduction.aspx
  6. second inspection of user's asp.net_sessionid cookie still shows ublbhu45ji31e055ywqu0555

why user shown introduction.apsx second time inside same asp.net session? i'm familiar w/ the risk in setting session variables before redirect in same postback, doesn't apply here, right?

keep in mind session has shorter lifetime session cookie being sent browser , id value set in cookie. in fact, browser can continue submit old session id, , server accept , create new session it, if old expired.

the implications being 2 possibilities: 1) session timing out due timeout config value (i know not case in particular instance)

2) we've figured out since in case via comments question: appdomain shutting down or being recycled.


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -