Session Time Out

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ShirishKumar
    New Member
    • Mar 2008
    • 7

    #1

    Session Time Out

    hi,

    I have one task, i want to show some information on my web page "Your Session has completed please login again",when the Session time out.

    thanks,
    Shirish.
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    You should be checking your session validity at each page load. If its not valid, you can redirect them to a page with that message?

    Comment

    • stoogots2
      New Member
      • Sep 2007
      • 77

      #3
      In my login pages, I generally add a session state variable. When the session times out, this variable will no longer exist. I call this method the Page_Load from all the pages in my last web app. You don't need it to do it in a static method, though, but I thought it might illustrate the necessary objects for you.

      public static void checklogin(Http SessionState s,Page r)
      {
      if (s["FullName"]==null)
      {
      s.Add("SessionE xpired","true") ;
      r.Response.Redi rect("login.asp x");
      }
      }

      Comment

      Working...