Class MemcachedSessionManager
java.lang.Object
com.predic8.membrane.core.interceptor.session.SessionManager
com.predic8.membrane.core.interceptor.session.MemcachedSessionManager
For testing, the class FakeSyncSessionStoreManager is used instead.
-
Field Summary
FieldsFields inherited from class com.predic8.membrane.core.interceptor.session.SessionManager
secure, SESSION, SESSION_COOKIE_ORIGINAL, SESSION_VALUE_SEPARATOR, sessionCookie, ttlExpiryRefreshOnAccess, usernameKeyName, VALUE_TO_EXPIRE_SESSION_IN_BROWSER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancookieRenewalNeeded(String originalCookie) Gets called when session was not modified.cookieValueToAttributes(String cookie) Transforms a cookie value into its attributes.getCookieValues(Session... session) Get the String identifier of the sessions to be used as cookie value.getInvalidCookies(Exchange exc, String validCookie) Get all cookies String representations from the request that are not valid anymore, e.g.voidprotected booleanGets called for every cookie value.voidremoveSession(Exchange exc) voidsetConnector(MemcachedConnector connector) voidsetCookiePrefix(String cookiePrefix) Set this, if you are running multiple parallel Membrane instances.Methods inherited from class com.predic8.membrane.core.interceptor.session.SessionManager
createCookieAttributes, createInvalidationAttributes, getAllCookieKeys, getCookieHeader, getCookieHeaderFields, getCookies, getDomain, getExpiresAfterSeconds, getIssuer, getSameSite, getSession, getSessionInternal, isHttpOnly, isSecure, isSessionCookie, isTtlExpiryRefreshOnAccess, postProcess, setDomain, setExpiresAfterSeconds, setHttpOnly, setIssuer, setSameSite, setSecure, setSessionCookie, setTtlExpiryRefreshOnAccess
-
Field Details
-
cookiePrefix
-
-
Constructor Details
-
MemcachedSessionManager
public MemcachedSessionManager()
-
-
Method Details
-
init
- Specified by:
initin classSessionManager- Throws:
Exception
-
cookieValueToAttributes
Description copied from class:SessionManagerTransforms a cookie value into its attributes. The cookie should be assumed valid as @isValidCookieForThisSessionManager was called beforehand- Specified by:
cookieValueToAttributesin classSessionManager
-
getCookieValues
Description copied from class:SessionManagerGet the String identifier of the sessions to be used as cookie value.- Specified by:
getCookieValuesin classSessionManager
-
getInvalidCookies
Description copied from class:SessionManagerGet all cookies String representations from the request that are not valid anymore, e.g. because the cookie is a self contained value and has changed or expired (e.g. jwt). Should return cookie values in the form of key=value.- Specified by:
getInvalidCookiesin classSessionManagervalidCookie- is the cookie value representation of the currently active session. Is key=value
-
isValidCookieForThisSessionManager
Description copied from class:SessionManagerGets called for every cookie value. Returns if the cookie value is valid and managed by this manager instance, e.g. jwt session manager checks if the cookie is a jwt, if it has the correct issuer, if it is not expired and if the signature is valid. Cookie is in format key=value- Specified by:
isValidCookieForThisSessionManagerin classSessionManager
-
cookieRenewalNeeded
Description copied from class:SessionManagerGets called when session was not modified. Should check, if session needs to be renewed (e.g. jwt expiration).- Specified by:
cookieRenewalNeededin classSessionManager- Parameters:
originalCookie- the original cookie from which the session was created (can be different from current session)- Returns:
-
removeSession
- Overrides:
removeSessionin classSessionManager
-
getConnector
-
setConnector
-
getCookiePrefix
-
setCookiePrefix
Set this, if you are running multiple parallel Membrane instances.- Default
- randomly chosen 8-character long string.
-