Package com.helger.web.scope.mgr
Class WebScopeSessionHelper
- java.lang.Object
-
- com.helger.web.scope.mgr.WebScopeSessionHelper
-
@Immutable public final class WebScopeSessionHelper extends Object
Some utility methods to handle complex actions in session scopes.- Author:
- Philip Helger
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.helger.commons.state.EChangerenewCurrentSessionScope(boolean bInvalidateHttpSession)Renew the current session scope.static ISessionWebScoperenewSessionScope(jakarta.servlet.http.HttpSession aHttpSession)Renew the session scope identified by the passed HTTP session.
-
-
-
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 theIScopeRenewalAwareinterface are kept.- Parameters:
bInvalidateHttpSession- iftruethe underlying HTTP session is also invalidated and a new session is created.- Returns:
EChange.UNCHANGEDif 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:
nullif nothing was changed, the new session web scope otherwise.
-
-