• Settings
    • Locale
    • Change the locale of the datepicker, schedule and client side validation messages.

      Language
      English
      English
      English
      French
      German
      German
      German
      Italian
      Korean
      Spanish
      Catalan
      Dutch
      Portuguese
      Portuguese
      Arabic
      Arabic
      Bulgarian
      Bangla
      Bosnian
      Czech
      Greek
      Estonian
      Persian
      Finnish
      Danish
      Hindi
      Indonesian
      Icelandic
      Croatian
      Japanese
      Hungarian
      Hebrew
      Georgian
      Central Kurdish
      Khmer
      Kyrgyz
      Kazakh
      Lithuanian
      Latvian
      Malay
      Norwegian
      Polish
      Romanian
      Russian
      Slovak
      Slovenian
      Serbian
      Serbian
      Swedish
      Thai
      Turkish
      Ukrainian
      Uzbek
      Vietnamese
      Chinese
      Chinese
  • Resources

Session

Session provides client-side callbacks to inform users about session timeout events within your web application.

Session Tag Documentation

Gives client-side Javascript events when session will expire.

NameTypeRequiredDefaultDescription
id String false generated Unique identifier of the component in a namingContainer.
rendered boolean false true Boolean value to specify the rendering of the component, when set to false component will not be rendered.
binding UIComponent false generated An EL expression referring to a server side UIComponent instance in a backing bean.
widgetVar String false generated ('widget_' + componentClientId) Name of the client side widget.
multiWindowSupport boolean false true Whether to support multiple browser windows/tabs.
onexpire String true Client-side callback when session is about to expire.
onexpired String true Client-side callback when session has expired.
reactionPeriod Integer false Reaction period in seconds.
Tag Documentation Widget Source
Basic usage

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.

Usage


<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>