Session Timeout - Warning and Redirect

Last post 11-12-2009 4:12 PM by mybestguess. 2 replies.

Sort Posts:

  • Session Timeout - Warning and Redirect

    10-28-2009, 3:41 PM
    • Member
      17 point Member
    • mybestguess
    • Member since 10-13-2008, 2:38 PM
    • Posts 30

    I am looking for a way to display a form that notifies the user that their session has expired (due to inactivicty).  Some pages use AJAX and others are regular pages.  Basically our site is a log system where users enter in log values.  There are times where they will "look up" information and the site becomes idle and their session timesout.  I am looking to implement a message much like banks have alerting users their session will timeout or has timedout.  When they click OK they are automatically redirected to the Login page.  Is this possible?

    I have javascript that alerts the user when a set period of time has passed but I can't get it to auto-redirect after they click ok.  Please help.

    MBG

  • Re: Session Timeout - Warning and Redirect

    10-28-2009, 5:20 PM
    Answer
    • Contributor
      2,236 point Contributor
    • mohsinaeem
    • Member since 05-08-2008, 7:41 AM
    • Fort Lauderdale, FL
    • Posts 336

    This thread may helps you

    http://social.msdn.microsoft.com/Forums/en-US/netfxjscript/thread/96412c97-c5b7-4ac1-b932-1815e56e0a49

    Mohsin Naeem
    MCPD 2.0, MCTS (SharePoint 2007, SQL Server 2005)
    "Please mark as answer if it helped you"
  • Re: Session Timeout - Warning and Redirect

    11-12-2009, 4:12 PM
    Answer
    • Member
      17 point Member
    • mybestguess
    • Member since 10-13-2008, 2:38 PM
    • Posts 30

    The following is the code I added to my page to redirect the user to the default page to force them to log back in.

    function timeoutCheck()
    {
        elapsedTime = elapsedTime + 1;

        if (elapsedTime > maxTime)
          {
            var answer = alert("Your session has expired. You will need to login again to continue."); 

            window.location = "Default.aspx";
          }

    }

Page 1 of 1 (3 items)