Saturday, March 31, 2012

Session Timeout..

When the session times out, I would like to navigate to the login page.
Currently when the session times out, the displayed screen remains visible
on the screen however when the user clicks on the screen will take to the
login page.

How to do that?

BenjaminYou could try using the javascript setTimeout function set to 20 minutes
(the default session timeout period) and then set the
document.location.href='login.aspx' via client side code.
Here's an example of using the javascript setTimeout function:
http://www.crowes.f9.co.uk/Javascript/timer.htm

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"Benjamin Smith" <BenSmithNg@.hotmail.com> wrote in message
news:%23%23YjkXrmEHA.3608@.TK2MSFTNGP09.phx.gbl...
> When the session times out, I would like to navigate to the login page.
> Currently when the session times out, the displayed screen remains visible
> on the screen however when the user clicks on the screen will take to the
> login page.
> How to do that?
> Benjamin
Hi i had the same problem.
Buti fixed..
If u need a more detailed script let me know!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Yes, I need to know.
Benjamin

"naijacoder naijacoder" <naijacoder@.toughguy.net> wrote in message
news:eu0aGPsmEHA.3988@.tk2msftngp13.phx.gbl...
> Hi i had the same problem.
> Buti fixed..
> If u need a more detailed script let me know!
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
But what do you really want to do?

"Benjamin Smith" <BenSmithNg@.hotmail.com> wrote in message
news:eFTtrasmEHA.2908@.TK2MSFTNGP12.phx.gbl...
> Yes, I need to know.
> Benjamin
> "naijacoder naijacoder" <naijacoder@.toughguy.net> wrote in message
> news:eu0aGPsmEHA.3988@.tk2msftngp13.phx.gbl...
> > Hi i had the same problem.
> > Buti fixed..
> > If u need a more detailed script let me know!
> > *** Sent via Developersdex http://www.developersdex.com ***
> > Don't just participate in USENET...get rewarded for it!
Steve gave you the answer. In more detail:

Session times out (by default) 20 minutes after the last Request was
received by the client browser instance holding that SessionID in a
temporary cookie. As no request is received on the server, no response can
be sent to the client. Therefore, the redirect MUST occur on the client.
That means JavaScript. And that means that your JavaScript function should
fire just as the Session times out (20 minutes). You would use the
JavaScript setTimeOut() function to accomplish this.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Benjamin Smith" <BenSmithNg@.hotmail.com> wrote in message
news:eFTtrasmEHA.2908@.TK2MSFTNGP12.phx.gbl...
> Yes, I need to know.
> Benjamin
> "naijacoder naijacoder" <naijacoder@.toughguy.net> wrote in message
> news:eu0aGPsmEHA.3988@.tk2msftngp13.phx.gbl...
> > Hi i had the same problem.
> > Buti fixed..
> > If u need a more detailed script let me know!
> > *** Sent via Developersdex http://www.developersdex.com ***
> > Don't just participate in USENET...get rewarded for it!
Thanks for your answers.

Now I understand I have to use setTimeout to achieve my goal.

The link http://www.crowes.f9.co.uk/Javascript/timer.htm is really helpful.

Which client side event I should use to keep track the user is still using
the website.

Thanks,

Benjamin

"Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
news:#lv4LermEHA.324@.TK2MSFTNGP11.phx.gbl...
> You could try using the javascript setTimeout function set to 20 minutes
> (the default session timeout period) and then set the
> document.location.href='login.aspx' via client side code.
> Here's an example of using the javascript setTimeout function:
> http://www.crowes.f9.co.uk/Javascript/timer.htm
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://Steve.Orr.net
>
> "Benjamin Smith" <BenSmithNg@.hotmail.com> wrote in message
> news:%23%23YjkXrmEHA.3608@.TK2MSFTNGP09.phx.gbl...
> > When the session times out, I would like to navigate to the login page.
> > Currently when the session times out, the displayed screen remains
visible
> > on the screen however when the user clicks on the screen will take to
the
> > login page.
> > How to do that?
> > Benjamin
Also I would like to inform the user just before X seconds of page expiry. I
do not want to use alert(). Is it possible to display the message on the
tool bar as once the count down for expire starts.

Thanks,

Benjamin

"Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
news:#lv4LermEHA.324@.TK2MSFTNGP11.phx.gbl...
> You could try using the javascript setTimeout function set to 20 minutes
> (the default session timeout period) and then set the
> document.location.href='login.aspx' via client side code.
> Here's an example of using the javascript setTimeout function:
> http://www.crowes.f9.co.uk/Javascript/timer.htm
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://Steve.Orr.net
>
> "Benjamin Smith" <BenSmithNg@.hotmail.com> wrote in message
> news:%23%23YjkXrmEHA.3608@.TK2MSFTNGP09.phx.gbl...
> > When the session times out, I would like to navigate to the login page.
> > Currently when the session times out, the displayed screen remains
visible
> > on the screen however when the user clicks on the screen will take to
the
> > login page.
> > How to do that?
> > Benjamin
The browser will keep track of that for you.
All you need is one client side event to fire once the trigger time has
elapsed and you want to warn the user.
You can name the event anything you want.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"Benjamin" <BenSmithNg@.hotmail.com> wrote in message
news:uan1PfQnEHA.392@.tk2msftngp13.phx.gbl...
> Thanks for your answers.
> Now I understand I have to use setTimeout to achieve my goal.
> The link http://www.crowes.f9.co.uk/Javascript/timer.htm is really
> helpful.
> Which client side event I should use to keep track the user is still using
> the website.
> Thanks,
> Benjamin
>
> "Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
> news:#lv4LermEHA.324@.TK2MSFTNGP11.phx.gbl...
>> You could try using the javascript setTimeout function set to 20 minutes
>> (the default session timeout period) and then set the
>> document.location.href='login.aspx' via client side code.
>> Here's an example of using the javascript setTimeout function:
>> http://www.crowes.f9.co.uk/Javascript/timer.htm
>>
>> --
>> I hope this helps,
>> Steve C. Orr, MCSD, MVP
>> http://Steve.Orr.net
>>
>>
>> "Benjamin Smith" <BenSmithNg@.hotmail.com> wrote in message
>> news:%23%23YjkXrmEHA.3608@.TK2MSFTNGP09.phx.gbl...
>> > When the session times out, I would like to navigate to the login page.
>> > Currently when the session times out, the displayed screen remains
> visible
>> > on the screen however when the user clicks on the screen will take to
> the
>> > login page.
>>> > How to do that?
>>> > Benjamin
>>>>
>>
Yes you can display a message to the status bar of the browser.
Here's a nice example:
http://simplythebest.net/scripts/DH...ascript_58.html

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"Benjamin" <BenSmithNg@.hotmail.com> wrote in message
news:uGdHQhQnEHA.3520@.TK2MSFTNGP11.phx.gbl...
> Also I would like to inform the user just before X seconds of page expiry.
> I
> do not want to use alert(). Is it possible to display the message on the
> tool bar as once the count down for expire starts.
> Thanks,
> Benjamin
>
> "Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
> news:#lv4LermEHA.324@.TK2MSFTNGP11.phx.gbl...
>> You could try using the javascript setTimeout function set to 20 minutes
>> (the default session timeout period) and then set the
>> document.location.href='login.aspx' via client side code.
>> Here's an example of using the javascript setTimeout function:
>> http://www.crowes.f9.co.uk/Javascript/timer.htm
>>
>> --
>> I hope this helps,
>> Steve C. Orr, MCSD, MVP
>> http://Steve.Orr.net
>>
>>
>> "Benjamin Smith" <BenSmithNg@.hotmail.com> wrote in message
>> news:%23%23YjkXrmEHA.3608@.TK2MSFTNGP09.phx.gbl...
>> > When the session times out, I would like to navigate to the login page.
>> > Currently when the session times out, the displayed screen remains
> visible
>> > on the screen however when the user clicks on the screen will take to
> the
>> > login page.
>>> > How to do that?
>>> > Benjamin
>>>>
>>

0 comments:

Post a Comment