Session timeout

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alvin Bruney

    #1

    Session timeout

    I'd like to prompt the user that their session is about to time out and give
    them the option to keep the session alive. Any ideas?

    By the time the session end event fires, the session is already ended so
    putting up a javascript box won't make sense since there is no session.

    I thought of client side which is good in theory but the only thing i could
    find was setwindow timeout and it does not measure inactivity, it is a sleep
    function.



  • Alvin Bruney

    #2
    Re: Session timeout

    i've figured out a way to do this. posting the code for newsgroup benefit

    <body onmousedown = "window_activit y()" onkeypress="win dow_activity()" >
    <script>
    var timerPROMPT = 0;
    var timerCLOSE = 0;

    function EndApp(){
    RateDeck.style. display = "none"
    spDeck.style.di splay = "none"
    }
    function StopTiming(){

    if(timerPROMPT > 0)
    window.clearTim eout(timerPROMP T)

    if (confirm('Due to inactivity, your session is about to time out.')
    == 1)
    {
    if(timerCLOSE > 0)
    window.clearTim eout(timerCLOSE )

    timerPROMPT = window.setTimeo ut("StopTiming( )",5000);
    timerCLOSE = window.setTimeo ut("EndApp()",8 000);
    }
    else
    {
    EndApp();
    }
    }
    function window_activity () {
    if(timerPROMPT > 0)
    window.clearTim eout(timerPROMP T)
    if(timerCLOSE > 0)
    window.clearTim eout(timerCLOSE )

    timerPROMPT = window.setTimeo ut("StopTiming( )",5000);
    timerCLOSE = window.setTimeo ut("EndApp()",6 000);
    }

    "Alvin Bruney" <vapordan_spam_ me_not@hotmail_ no_spamhotmail. com> wrote in
    message news:OWnrOVvUDH A.2184@TK2MSFTN GP10.phx.gbl...[color=blue]
    > I'd like to prompt the user that their session is about to time out and[/color]
    give[color=blue]
    > them the option to keep the session alive. Any ideas?
    >
    > By the time the session end event fires, the session is already ended so
    > putting up a javascript box won't make sense since there is no session.
    >
    > I thought of client side which is good in theory but the only thing i[/color]
    could[color=blue]
    > find was setwindow timeout and it does not measure inactivity, it is a[/color]
    sleep[color=blue]
    > function.
    >
    >
    >[/color]


    Comment

    Working...