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

2014-03-12 Thread Bruce Lombardi
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?

2014-03-12 Thread Martin Grigorov
Hi,


On Wed, Mar 12, 2014 at 5:09 PM, Bruce Lombardi brlom...@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




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

2014-03-12 Thread Bruce Lombardi
Thanks Martin,  for the rapid response. Has anyone done anything like this  
this?

Bruce

-Original Message-
From: Martin Grigorov [mailto:mgrigo...@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 brlom...@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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org