Class WebScopeSessionHelper


  • @Immutable
    public final class WebScopeSessionHelper
    extends Object
    Some utility methods to handle complex actions in session scopes.
    Author:
    Philip Helger
    • Method Detail

      • renewCurrentSessionScope

        @Nonnull
        public static com.helger.commons.state.EChange renewCurrentSessionScope​(boolean bInvalidateHttpSession)
        Renew the current session scope. This means all session and session application scopes are cleared, and only attributes implementing the IScopeRenewalAware interface are kept.
        Parameters:
        bInvalidateHttpSession - if true the underlying HTTP session is also invalidated and a new session is created.
        Returns:
        EChange.UNCHANGED if no session scope is present.
      • renewSessionScope

        @Nullable
        public static ISessionWebScope renewSessionScope​(@Nonnull
                                                         jakarta.servlet.http.HttpSession aHttpSession)
        Renew the session scope identified by the passed HTTP session. Note: the underlying HTTP session is not invalidate, because we have no way to retrieve a new underlying HTTP session, because no request is present.
        Parameters:
        aHttpSession - The HTTP session to be renewed.
        Returns:
        null if nothing was changed, the new session web scope otherwise.