You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Bruce Lombardi <br...@gmail.com> on 2014/03/12 16:09:34 UTC

How di I display a new page on session timeout without requiring the user to do anything?

Hi,

 

I have a requirement that says that, for security purposes, when a session
times out, the application must go to a different page so that any data
displayed is hidden and that the user must  be informed that the session has
timed out.  In the init method of my Application class, which subclasses
AuthenticatedApplication, I  have the following line.

 

getApplicationSettings().setPageExpiredErrorPage(SessionTimeoutPage.class);

 

So now, after the session expires, if the user clicks on anything it goes to
the SessionTimeoutPage. This is not the behavior I need, so I've done some
searching and found some suggestions on using AjaxTimerBehavior to warn a
user that a session is about to expire, but nothing that says exactly how to
detect an expired session. Also, some people have hinted that Ajax could
actually keep the session alive so I'm a little confused about that. 

 

Can someone please clarify this and at least point me in the right direction
for fulfilling my requirements?

 

Thanks,

Bruce


RE: How di I display a new page on session timeout without requiring the user to do anything?

Posted by Bruce Lombardi <br...@gmail.com>.
Thanks Martin,  for the rapid response. Has anyone done anything like this  this?

Bruce

-----Original Message-----
From: Martin Grigorov [mailto:mgrigorov@apache.org] 
Sent: Wednesday, March 12, 2014 11:26 AM
To: users@wicket.apache.org
Subject: Re: How di I display a new page on session timeout without requiring the user to do anything?

Hi,


On Wed, Mar 12, 2014 at 5:09 PM, Bruce Lombardi <br...@gmail.com> wrote:

> Hi,
>
>
>
> I have a requirement that says that, for security purposes, when a 
> session times out, the application must go to a different page so that 
> any data displayed is hidden and that the user must  be informed that 
> the session has timed out.  In the init method of my Application 
> class, which subclasses AuthenticatedApplication, I  have the 
> following line.
>
>
>
> getApplicationSettings().setPageExpiredErrorPage(SessionTimeoutPage.cl
> ass);
>
>
>
> So now, after the session expires, if the user clicks on anything it 
> goes to the SessionTimeoutPage. This is not the behavior I need, so 
> I've done some searching and found some suggestions on using 
> AjaxTimerBehavior to warn a user that a session is about to expire, 
> but nothing that says exactly how to detect an expired session. Also, 
> some people have hinted that Ajax could actually keep the session 
> alive so I'm a little confused about that.
>

This is correct.
Any request to the server will touch the session and thus will keep it alive.


>
>
>
> Can someone please clarify this and at least point me in the right 
> direction for fulfilling my requirements?
>

Your best bet is to use JavaScript counter that will count down do
document.location.href="anotherUrl"; when the counter reaches 0.
You will have to reinit the counter with every ajax request - this is easy.


>
>
>
> Thanks,
>
> Bruce
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How di I display a new page on session timeout without requiring the user to do anything?

Posted by Martin Grigorov <mg...@apache.org>.
Hi,


On Wed, Mar 12, 2014 at 5:09 PM, Bruce Lombardi <br...@gmail.com> wrote:

> Hi,
>
>
>
> I have a requirement that says that, for security purposes, when a session
> times out, the application must go to a different page so that any data
> displayed is hidden and that the user must  be informed that the session
> has
> timed out.  In the init method of my Application class, which subclasses
> AuthenticatedApplication, I  have the following line.
>
>
>
> getApplicationSettings().setPageExpiredErrorPage(SessionTimeoutPage.class);
>
>
>
> So now, after the session expires, if the user clicks on anything it goes
> to
> the SessionTimeoutPage. This is not the behavior I need, so I've done some
> searching and found some suggestions on using AjaxTimerBehavior to warn a
> user that a session is about to expire, but nothing that says exactly how
> to
> detect an expired session. Also, some people have hinted that Ajax could
> actually keep the session alive so I'm a little confused about that.
>

This is correct.
Any request to the server will touch the session and thus will keep it
alive.


>
>
>
> Can someone please clarify this and at least point me in the right
> direction
> for fulfilling my requirements?
>

Your best bet is to use JavaScript counter that will count down do
document.location.href="anotherUrl"; when the counter reaches 0.
You will have to reinit the counter with every ajax request - this is easy.


>
>
>
> Thanks,
>
> Bruce
>
>