public class SessionHandlerImpl extends Object implements SessionHandler
| Modifier and Type | Field and Description |
|---|---|
static String |
SESSION_FLUSHED_KEY |
static String |
SESSION_STOREUSER_KEY |
static String |
SESSION_USER_HOLDER_KEY |
DEFAULT_COOKIE_HTTP_ONLY_FLAG, DEFAULT_COOKIE_SECURE_FLAG, DEFAULT_LAZY_SESSION, DEFAULT_NAG_HTTPS, DEFAULT_SESSION_COOKIE_NAME, DEFAULT_SESSION_COOKIE_PATH, DEFAULT_SESSION_TIMEOUT, DEFAULT_SESSIONID_MIN_LENGTH| Constructor and Description |
|---|
SessionHandlerImpl(SessionStore sessionStore) |
| Modifier and Type | Method and Description |
|---|---|
SessionHandler |
flush(RoutingContext context,
boolean ignoreStatus,
Handler<AsyncResult<Void>> handler)
Flush a context session earlier to the store, this will allow the end user to have full control on the event of
a failure at the store level.
|
SessionHandler |
flush(RoutingContext context,
Handler<AsyncResult<Void>> handler)
Flush a context session earlier to the store, this will allow the end user to have full control on the event of
a failure at the store level.
|
void |
handle(RoutingContext context)
Something has happened, so handle it.
|
Session |
newSession(RoutingContext context)
Create a new session
|
SessionHandler |
setAuthProvider(AuthProvider authProvider)
Deprecated.
|
SessionHandler |
setCookieHttpOnlyFlag(boolean httpOnly)
Sets whether the 'HttpOnly' flag should be set for the session cookie.
|
SessionHandler |
setCookieless(boolean cookieless)
Use sessions based on url paths instead of cookies.
|
SessionHandler |
setCookieMaxAge(long cookieMaxAge)
Set a Cookie max-age to the session cookie.
|
SessionHandler |
setCookieSameSite(CookieSameSite policy)
Set the session cookie SameSite policy to use.
|
SessionHandler |
setCookieSecureFlag(boolean secure)
Sets whether the 'secure' flag should be set for the session cookie.
|
SessionHandler |
setLazySession(boolean lazySession)
Use a lazy session creation mechanism.
|
SessionHandler |
setMinLength(int minLength)
Set expected session id minimum length.
|
SessionHandler |
setNagHttps(boolean nag)
Set whether a nagging log warning should be written if the session handler is
accessed over HTTP, not HTTPS
|
SessionHandler |
setSessionCookieName(String sessionCookieName)
Set the session cookie name
|
SessionHandler |
setSessionCookiePath(String sessionCookiePath)
Set the session cookie path
|
SessionHandler |
setSessionTimeout(long timeout)
Set the session timeout
|
Future<Void> |
setUser(RoutingContext context,
User user)
Set the user for the session
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreate, flush, flush, setUserpublic static final String SESSION_USER_HOLDER_KEY
public static final String SESSION_FLUSHED_KEY
public static final String SESSION_STOREUSER_KEY
public SessionHandlerImpl(SessionStore sessionStore)
public SessionHandler setSessionTimeout(long timeout)
SessionHandlersetSessionTimeout in interface SessionHandlertimeout - the timeout, in ms.public SessionHandler setNagHttps(boolean nag)
SessionHandlersetNagHttps in interface SessionHandlernag - true to nagpublic SessionHandler setCookieSecureFlag(boolean secure)
SessionHandlersetCookieSecureFlag in interface SessionHandlersecure - true to set the secure flag on the cookiepublic SessionHandler setCookieHttpOnlyFlag(boolean httpOnly)
SessionHandlersetCookieHttpOnlyFlag in interface SessionHandlerhttpOnly - true to set the HttpOnly flag on the cookiepublic SessionHandler setSessionCookieName(String sessionCookieName)
SessionHandlersetSessionCookieName in interface SessionHandlersessionCookieName - the session cookie namepublic SessionHandler setSessionCookiePath(String sessionCookiePath)
SessionHandlersetSessionCookiePath in interface SessionHandlersessionCookiePath - the session cookie pathpublic SessionHandler setMinLength(int minLength)
SessionHandlersetMinLength in interface SessionHandlerminLength - the session id minimal lengthpublic SessionHandler setCookieSameSite(CookieSameSite policy)
SessionHandlersetCookieSameSite in interface SessionHandlerpolicy - to use, null for no policy.public SessionHandler setLazySession(boolean lazySession)
SessionHandlersetLazySession in interface SessionHandlerlazySession - true to have a lazy session creation.public SessionHandler setCookieMaxAge(long cookieMaxAge)
SessionHandlersetCookieMaxAge in interface SessionHandlercookieMaxAge - a non negative max-age, note that 0 means expire now.@Deprecated public SessionHandler setAuthProvider(AuthProvider authProvider)
SessionHandlersetAuthProvider in interface SessionHandlerauthProvider - any auth provider.public SessionHandler setCookieless(boolean cookieless)
SessionHandlersetCookieless in interface SessionHandlercookieless - true if a cookieless session should be usedpublic SessionHandler flush(RoutingContext context, Handler<AsyncResult<Void>> handler)
SessionHandlerflush in interface SessionHandlercontext - the current contexthandler - the event handler to signal a asynchronous response.public SessionHandler flush(RoutingContext context, boolean ignoreStatus, Handler<AsyncResult<Void>> handler)
SessionHandlerflush in interface SessionHandlercontext - the current contextignoreStatus - flush regardless of response status codehandler - the event handler to signal a asynchronous response.public void handle(RoutingContext context)
Handlerhandle in interface Handler<RoutingContext>context - the event to handlepublic Session newSession(RoutingContext context)
SessionHandlernewSession in interface SessionHandlercontext - the routing contextpublic Future<Void> setUser(RoutingContext context, User user)
SessionHandlersetUser in interface SessionHandlercontext - the routing contextuser - the userCopyright © 2021. All rights reserved.