Session provides client-side callbacks to inform users about session timeout events within your web application.
The basic configuration for client-side session management. A warning dialog is shown reactionPeriod (60 s) before the session expires, followed by an expiry dialog.
The showcase session timeout is 60 minutes, so the dialogs only appear after a long idle time. After expiry, reload the page to continue.
<div class="card">
<h5>Basic usage</h5>
<p>The basic configuration for client-side session management. A warning dialog is shown <code>reactionPeriod</code> (60 s) before the session expires, followed by an expiry dialog.
The showcase session timeout is 60 minutes, so the dialogs only appear after a long idle time. After expiry, reload the page to continue.</p>
<pe:session onexpire="PF('sessionDialog').show()"
onexpired="PF('sessionDialog').hide();PF('sessionExpiredDialog').show()"
reactionPeriod="60"
multiWindowSupport="true"/>
<p:dialog widgetVar="sessionDialog" header="Session Warning">
<p>
Your session is about to expire.
</p>
<h:form id="formBasic">
<p:commandButton value="Keep my session alive." update="@none" onsuccess="PF('sessionDialog').hide()"/>
</h:form>
</p:dialog>
<p:dialog widgetVar="sessionExpiredDialog" header="Session Expired">
<p>
Your session has expired. Reload the page to continue.
</p>
</p:dialog>
</div>