idleMonitor: Session timeout handling

UI Components for JSF
Post Reply
markusg80
Posts: 69
Joined: 21 Nov 2013, 17:11

17 Oct 2018, 11:54

I have a idleMonitor to observe inactivity by the user and autologout after when idle event is fired. Now the Problem is when the user is not active and after a while he moves the mouse it reset the time of the idleMonitor but not on the Server side. The Server side timeout is only reseted if a request occours. Now how can i get an event when the idleMonitor timer is reset? Then i can make a request so the idleMonitor timer and Server Session Timeout timer are equal.
PrimeFaces 12.0.0,Mojarra 4.0.0,Payara 6

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

17 Oct 2018, 13:23

p:ajax event=active ;)
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

markusg80
Posts: 69
Joined: 21 Nov 2013, 17:11

17 Oct 2018, 14:41

This event is only fired when first idle event was fired! But in my case idle event is never fired because the user is mouving the mouse with out sending request
PrimeFaces 12.0.0,Mojarra 4.0.0,Payara 6

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

17 Oct 2018, 14:47

No idea then. feel free to provide a pull request, so i can check your idea, how we can improve the component.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

f6750699
Posts: 21
Joined: 09 Oct 2013, 03:43

17 Oct 2018, 19:26

Marcel Vieira
Primefaces 6.2 / JSF 2.2 / Glassfish 4

markusg80
Posts: 69
Joined: 21 Nov 2013, 17:11

20 Oct 2018, 14:20

@tandraschko My idea to improve the Component is to add a reset ajax event. So every time the user is not active, the time begin to run until reaching the timeout value. When the user again comes active, before reaching the timeout value, with for example mouse moving, the internal timer of the idlemonitor gets reseted, like it already is but in addition it fires a reset ajax event. With this event i can call a keepalive funtion on server side to ensure the timeout of the server is equal to that of the idleMonitor
PrimeFaces 12.0.0,Mojarra 4.0.0,Payara 6

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

20 Oct 2018, 15:09

But if the user keeps moving the mouse without actually interacting with the server, the client and server timeout will still not be equal ;-)

markusg80
Posts: 69
Joined: 21 Nov 2013, 17:11

20 Oct 2018, 15:41

No everytime the user moves the mouse the reset event will be fired! But i see that this will fire a many reset event;-) maybe ot needed to make a attribute to delay start counting the inactive time
PrimeFaces 12.0.0,Mojarra 4.0.0,Payara 6

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 45 guests