I have JSF web page using PrimeFaces 5.1 and I want to redirect redirect to some xhtml page once session is expired.
I have set session timeout to 1 minute (for testing it will be set to 30 after that) in web.xml
<session-config>
<session-timeout>1</session-timeout>
</session-config>
And i have added
<meta http-equiv="refresh" content="#{session.maxInactiveInterval};url=#{request.contextPath}/season_expired.xhtml"/>
to <h:head>
of the default template which is used on every page of the application.
Everything works fine for the most of the time (when I move between pages etc..) except when I'm using using some form where every refresh is made by AJAX. Then i get redirected after one minute.
Is there a way to "refresh" session with AJAX?