Class SessionCookie
java.lang.Object
services.moleculer.service.MoleculerComponent
services.moleculer.service.Service
services.moleculer.web.middleware.HttpMiddleware
services.moleculer.web.middleware.session.SessionCookie
- All Implemented Interfaces:
services.moleculer.service.MoleculerLifecycle, HttpConstants
Generates Session Cookies, and sets the cookie header. Sample:
route.use(new SessionCookie("SID"));
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected WeakHashMap<String, HttpCookie> protected StringCookie name.protected longCookie timeout in SECONDS (0 = no timeout).protected StringCookie path.protected AtomicLongprotected AtomicLongprotected SessionStoreFields inherited from class services.moleculer.service.MoleculerComponent
broker, logger, nameFields inherited from interface HttpConstants
ACCEPT, ACCEPT_ENCODING, AUTHORIZATION, CACHE_CONTROL, CHUNKED, CLOSE, CONNECT, CONNECTION, CONTENT_ENCODING, CONTENT_LENGTH, CONTENT_TYPE, CONTENT_TYPE_HTML, CONTENT_TYPE_JSON, COOKIE, DEFLATE, DELETE, ETAG, GET, GZIP, HEAD, IF_NONE_MATCH, KEEP_ALIVE, LOCATION, META_CONTENT_TYPE, META_HEADERS, META_LOCALE, META_LOCATION, META_SESSION, META_STATUS, META_TEMPLATE, NO_CACHE, OPTIONS, PATCH, POST, PROPERTY_COOKIES, PROPERTY_SESSION_ID, PROPERTY_USER, PUT, SET_COOKIE, TRACE, TRANSFER_ENCODING, WWW_AUTHENTICATE, X_FORWARDED_FOR -
Constructor Summary
ConstructorsConstructorDescriptionSessionCookie(String cookieName) SessionCookie(String cookieName, String path) -
Method Summary
Modifier and TypeMethodDescriptiongetPath()install(RequestProcessor next, io.datatree.Tree config) protected StringnextID()voidsetCookieName(String cookieName) voidMethods inherited from class services.moleculer.service.MoleculerComponent
getBroker, getLogger, getName, started, stopped
-
Field Details
-
cookieName
Cookie name. -
path
Cookie path. -
maxAge
protected long maxAgeCookie timeout in SECONDS (0 = no timeout). -
rnd
-
seq
-
cookieCache
-
store
-
-
Constructor Details
-
SessionCookie
public SessionCookie() -
SessionCookie
-
SessionCookie
-
-
Method Details
-
install
- Specified by:
installin classHttpMiddleware
-
nextID
-
getCookieName
-
setCookieName
-
getPath
-
setPath
-