Hi
I have a view bean along with UI page say main.xhtml. there is a poll in main.xhtml which sends request to view bean every 30 seconds. I want all main.xhtml pages stop sending request after session expiration eg. after user logout.
I tried to implement this with a SessionListener class but I wasn't successfull. is there any way to handle this situation either with server side code or client side code?
Thanks
stop all polls on session destroy
-
- Posts: 6144
- Joined: 10 Sep 2011, 21:10
How to redirect to index page if session time out happend in jsf application
click URL above and read BalusC's answer
my opinion/recommendation... do not leave that page in the browser with stopped polling. if session destroyed, then navigate/redirect the page to a session expired or login page.
click URL above and read BalusC's answer
my opinion/recommendation... do not leave that page in the browser with stopped polling. if session destroyed, then navigate/redirect the page to a session expired or login page.
Howard
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
-
- Posts: 4
- Joined: 08 Jun 2016, 08:31
Late reply, but similar issue!
I have also a poll component on every page which has an intervall of 60 seconds. But with the poll component the HttpSessionListener#sessionDestroyed method will never be called - because there is always an activity! My session timeout is 10 minutes!
So how to distinguish between real activity and activity raised by the poll component?
I have also a poll component on every page which has an intervall of 60 seconds. But with the poll component the HttpSessionListener#sessionDestroyed method will never be called - because there is always an activity! My session timeout is 10 minutes!
So how to distinguish between real activity and activity raised by the poll component?
The short answer is you can't. Your poller is keeping your session alive and will indefinitely.
That is why we also use an idle poller so if the user is off the tab or stops moving the mouse after N minutes we terminate the poller and log them out of the app.
That is why we also use an idle poller so if the user is off the tab or stops moving the mouse after N minutes we terminate the poller and log them out of the app.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1
-
- Posts: 4
- Joined: 08 Jun 2016, 08:31
@Melloware: Thanks for your hint! I solved it by using an , which invalidates my session an redirects to the login page.
Code: Select all
<p:idleMonitor>
Also, you might want to use a web socket instead.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub: https://github.com/jepsar
Spotify: 90s Rave, Acid, Trance, House
GitHub: https://github.com/jepsar
Spotify: 90s Rave, Acid, Trance, House
-
- Information
-
Who is online
Users browsing this forum: No registered users and 15 guests