Zone update and inactive timeout

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Zone update and inactive timeout

.. ...
Hi,

  I am using tapestry 5.4.1 together with jetty 9.2.14.v20151106.

  I want to set inactive timeout. When users is doing nothing application
should logout after some time.
  I set timeout by setting
webapp.getSessionHandler().getSessionManager().setMaxInactiveInterval(30)
to 30 seconds. Zone in webpage updates every 5 seconds. With these settings
session was unable to timeout.

 When I set maxInactiveInterval to one second, session expires as expected.

  Is there any way to have larger timeout than zone update interval?

  Vavricka
Reply | Threaded
Open this post in threaded view
|

Re: Zone update and inactive timeout

Marvin Monroe
Hi Vavricka,

every time you poll the server the session timeout is reset.
You could track real user activity on your own in the browser using some js and issue a logout request after 30 minutes or so...

Cheers
Christian


> Am 10.11.2016 um 09:26 schrieb .. ... <[hidden email]>:
>
> Hi,
>
>  I am using tapestry 5.4.1 together with jetty 9.2.14.v20151106.
>
>  I want to set inactive timeout. When users is doing nothing application
> should logout after some time.
>  I set timeout by setting
> webapp.getSessionHandler().getSessionManager().setMaxInactiveInterval(30)
> to 30 seconds. Zone in webpage updates every 5 seconds. With these settings
> session was unable to timeout.
>
> When I set maxInactiveInterval to one second, session expires as expected.
>
>  Is there any way to have larger timeout than zone update interval?
>
>  Vavricka


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Zone update and inactive timeout

Cezary Biernacki
In reply to this post by .. ...
The problem is caused by AJAX polling, and it is not specific to Tapestry,
but to how Java servlet containers manage sessions. I had similar one (AJAX
polling with Jetty) and IIRC I solved it by implementing my own
SessionHandler and SessionManager classes (subclassing and replacing ones
provided by Jetty) that avoided "de-idling" sessions for AJAX-polling
related paths.

Best regards,
Cezary


On Thu, Nov 10, 2016 at 9:26 AM, .. ... <[hidden email]> wrote:

> Hi,
>
>   I am using tapestry 5.4.1 together with jetty 9.2.14.v20151106.
>
>   I want to set inactive timeout. When users is doing nothing application
> should logout after some time.
>   I set timeout by setting
> webapp.getSessionHandler().getSessionManager().setMaxInactiveInterval(30)
> to 30 seconds. Zone in webpage updates every 5 seconds. With these settings
> session was unable to timeout.
>
>  When I set maxInactiveInterval to one second, session expires as expected.
>
>   Is there any way to have larger timeout than zone update interval?
>
>   Vavricka
>
Reply | Threaded
Open this post in threaded view
|

Re: Zone update and inactive timeout

.. ...
Thanks both of you.

I used Christian Riedel suggestion and it worked like a charm.

Vavricka

On Thu, Nov 10, 2016 at 10:55 AM, Cezary Biernacki <[hidden email]>
wrote:

> The problem is caused by AJAX polling, and it is not specific to Tapestry,
> but to how Java servlet containers manage sessions. I had similar one (AJAX
> polling with Jetty) and IIRC I solved it by implementing my own
> SessionHandler and SessionManager classes (subclassing and replacing ones
> provided by Jetty) that avoided "de-idling" sessions for AJAX-polling
> related paths.
>
> Best regards,
> Cezary
>
>
> On Thu, Nov 10, 2016 at 9:26 AM, .. ... <[hidden email]> wrote:
>
> > Hi,
> >
> >   I am using tapestry 5.4.1 together with jetty 9.2.14.v20151106.
> >
> >   I want to set inactive timeout. When users is doing nothing application
> > should logout after some time.
> >   I set timeout by setting
> > webapp.getSessionHandler().getSessionManager().
> setMaxInactiveInterval(30)
> > to 30 seconds. Zone in webpage updates every 5 seconds. With these
> settings
> > session was unable to timeout.
> >
> >  When I set maxInactiveInterval to one second, session expires as
> expected.
> >
> >   Is there any way to have larger timeout than zone update interval?
> >
> >   Vavricka
> >
>