Package io.undertow.server.session
Class SessionCookieConfig
java.lang.Object
io.undertow.server.session.SessionCookieConfig
- All Implemented Interfaces:
SessionConfig
Encapsulation of session cookie configuration. This removes the need for the session manager to
know about cookie configuration.
- Author:
- Stuart Douglas
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.undertow.server.session.SessionConfig
SessionConfig.SessionCookieSource -
Field Summary
FieldsFields inherited from interface io.undertow.server.session.SessionConfig
ATTACHMENT_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclearSession(HttpServerExchange exchange, String sessionId) Clears this session from the exchange, removing the attachment and making any changes to the response necessary, such as clearing cookies.findSessionId(HttpServerExchange exchange) Retrieves a session id of an existing session from an exchange.intgetPath()booleanbooleanbooleanisSecure()rewriteUrl(String originalUrl, String sessionId) sessionCookieSource(HttpServerExchange exchange) setComment(String comment) setCookieName(String cookieName) setDiscard(boolean discard) setHttpOnly(boolean httpOnly) setMaxAge(int maxAge) setSecure(boolean secure) voidsetSessionId(HttpServerExchange exchange, String sessionId) Attaches the session to the exchange.
-
Field Details
-
DEFAULT_SESSION_ID
- See Also:
-
-
Constructor Details
-
SessionCookieConfig
public SessionCookieConfig()
-
-
Method Details
-
rewriteUrl
- Specified by:
rewriteUrlin interfaceSessionConfig
-
setSessionId
Description copied from interface:SessionConfigAttaches the session to the exchange. The method should attach the exchange under an attachment key, and should also modify the exchange to allow the session to be re-attached on the next request.Generally this will involve setting a cookie
Once a session has been attached it must be possible to retrieve it via
SessionConfig.findSessionId(io.undertow.server.HttpServerExchange)- Specified by:
setSessionIdin interfaceSessionConfig- Parameters:
exchange- The exchangesessionId- The session
-
clearSession
Description copied from interface:SessionConfigClears this session from the exchange, removing the attachment and making any changes to the response necessary, such as clearing cookies.- Specified by:
clearSessionin interfaceSessionConfig- Parameters:
exchange- The exchangesessionId- The session id
-
findSessionId
Description copied from interface:SessionConfigRetrieves a session id of an existing session from an exchange.- Specified by:
findSessionIdin interfaceSessionConfig- Parameters:
exchange- The exchange- Returns:
- The session id, or null
-
sessionCookieSource
- Specified by:
sessionCookieSourcein interfaceSessionConfig
-
getCookieName
-
setCookieName
-
getPath
-
setPath
-
getDomain
-
setDomain
-
isDiscard
public boolean isDiscard() -
setDiscard
-
isSecure
public boolean isSecure() -
setSecure
-
isHttpOnly
public boolean isHttpOnly() -
setHttpOnly
-
getMaxAge
public int getMaxAge() -
setMaxAge
-
getComment
-
setComment
-