rice-framework/krad-web/src/main/webapp/krad/scripts/krad.session.js
/**
 * Handler for the storage event that checks for message broadcast for session events
 *
 * <p>
 * There are two types of messages sent through this event. One is the session update event. This gets
 * broadcast when another window has been refreshed (thus the session on the server has been refreshed and we
 * want to reset the timer for this window). The other message is broadcast when the user responds to a session
 * dialog in another window. In this case we want to close any session dialog that might be open in this window
 * and take the corresponding action
 * </p>
 *
 * @param event instance of a storage event where the key is the message type being sent
 */
Handler for the storage event that checks for message broadcast for session events


There are two types of messages sent through this event. One is the session update event. This gets
broadcast when another window has been refreshed (thus the session on the server has been refreshed and we
want to reset the timer for this window). The other message is broadcast when the user responds to a session
dialog in another window. In this case we want to close any session dialog that might be open in this window
and take the corresponding action


@param event instance of a storage event where the key is the message type being sent
Handler for the storage event that checks for message broadcast for session events There are two types of messages sent through this event . One is the session update event . This gets broadcast when another window has been refreshed ( thus the session on the server has been refreshed and we want to reset the timer for this window ) . The other message is broadcast when the user responds to a session dialog in another window . In this case we want to close any session dialog that might be open in this window and take the corresponding action @param event instance of a storage event where the key is the message type being sent
function checkForSessionUpdate(event) {
    if ((event.key == 'sessionUpdate') && (event.newValue == true)) {
        resetSessionTimers();
    }
    if (event.key == 'sessionDialogResponse') {
        if (activeDialogId == kradVariables.SESSION_TIMEOUT_WARNING_DIALOG) {
            dismissDialog(kradVariables.SESSION_TIMEOUT_WARNING_DIALOG);
        }
        else if (activeDialogId == kradVariables.SESSION_TIMEOUT_DIALOG) {
            dismissDialog(kradVariables.SESSION_TIMEOUT_DIALOG);
        }
        if (event.newValue == 'continue') {
            resetSessionTimers();
        }
        else if (event.newValue == 'logout') {
            logoutUser();
        }
    }
}
function checkForSessionUpdate ( event ) { if ( ( event . key == 'sessionUpdate' ) && ( event . newValue == true ) ) { resetSessionTimers ( ) ; } if ( event . key == 'sessionDialogResponse' ) { if ( activeDialogId == kradVariables . SESSION_TIMEOUT_WARNING_DIALOG ) { dismissDialog ( kradVariables . SESSION_TIMEOUT_WARNING_DIALOG ) ; } else if ( activeDialogId == kradVariables . SESSION_TIMEOUT_DIALOG ) { dismissDialog ( kradVariables . SESSION_TIMEOUT_DIALOG ) ; } if ( event . newValue == 'continue' ) { resetSessionTimers ( ) ; } else if ( event . newValue == 'logout' ) { logoutUser ( ) ; } } }
Handler for the storage event that checks for message broadcast for session events
Handler for the storage event that checks for message broadcast for session events
// if another page was refreshed reset the session timers for this page
 // if the user responded to a session dialog in another page, we need to reset the timers (in the case of continue)
 // and close the session dialogs for this page if any are displaying
