Class SessionManager
java.lang.Object
com.predic8.membrane.core.config.AbstractXmlElement
com.predic8.membrane.core.interceptor.authentication.session.SessionManager
- All Implemented Interfaces:
XMLElement,CleanupThread.Cleaner
- Direct Known Subclasses:
JwtSessionManager
- Explanation
The Session Manager identifies users across HTTP requests using a session cookie.
The name of the session cookie can be specified using the cookieName attribute. The default name is "SESSIONID".
The session timeout can be specified in milliseconds using the timeout attribute. The default timeout is 5 minutes.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanup()createSession(Exchange exc) getSession(Exchange exc) longvoidprotected voidparseAttributes(XMLStreamReader token) voidpostProcess(Exchange exc) Sets the Session Cookie on the response, if necessary (e.g.voidremoveSession(Exchange exc) voidvoidsetCookieName(String cookieName) voidvoidsetTimeout(long timeout) Methods inherited from class com.predic8.membrane.core.config.AbstractXmlElement
doAfterParsing, getBoolean, getElementName, move2RootElementIfNeeded, parse, parseCharacters, parseChildren, toXml, write, writeIfNotNull
-
Field Details
-
SESSION_ID
- See Also:
-
SESSION
- See Also:
-
-
Constructor Details
-
SessionManager
public SessionManager()
-
-
Method Details
-
parseAttributes
- Overrides:
parseAttributesin classAbstractXmlElement- Throws:
Exception
-
init
-
postProcess
Sets the Session Cookie on the response, if necessary (e.g. a session was created) -
getOrCreateSession
-
removeSession
-
removeSession
-
getSession
-
createSession
-
cleanup
public void cleanup()- Specified by:
cleanupin interfaceCleanupThread.Cleaner
-
getCookieName
-
setCookieName
-
getTimeout
public long getTimeout() -
setTimeout
public void setTimeout(long timeout) -
getDomain
-
setDomain
-