Package io.undertow.servlet.spec
Class SessionCookieConfigImpl
- java.lang.Object
-
- io.undertow.servlet.spec.SessionCookieConfigImpl
-
- All Implemented Interfaces:
SessionConfig,javax.servlet.SessionCookieConfig
public class SessionCookieConfigImpl extends Object implements javax.servlet.SessionCookieConfig, SessionConfig
- Author:
- Stuart Douglas
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.undertow.server.session.SessionConfig
SessionConfig.SessionCookieSource
-
-
Field Summary
-
Fields inherited from interface io.undertow.server.session.SessionConfig
ATTACHMENT_KEY
-
-
Constructor Summary
Constructors Constructor Description SessionCookieConfigImpl(ServletContextImpl servletContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearSession(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.StringfindSessionId(HttpServerExchange exchange)Retrieves a session id of an existing session from an exchange.StringgetComment()StringgetDomain()SessionConfiggetFallback()intgetMaxAge()StringgetName()StringgetPath()booleanisHttpOnly()booleanisSecure()StringrewriteUrl(String originalUrl, String sessionid)SessionConfig.SessionCookieSourcesessionCookieSource(HttpServerExchange exchange)voidsetComment(String comment)voidsetDomain(String domain)voidsetFallback(SessionConfig fallback)voidsetHttpOnly(boolean httpOnly)voidsetMaxAge(int maxAge)voidsetName(String name)voidsetPath(String path)voidsetSecure(boolean secure)voidsetSessionId(HttpServerExchange exchange, String sessionId)Attaches the session to the exchange.
-
-
-
Constructor Detail
-
SessionCookieConfigImpl
public SessionCookieConfigImpl(ServletContextImpl servletContext)
-
-
Method Detail
-
rewriteUrl
public String rewriteUrl(String originalUrl, String sessionid)
- Specified by:
rewriteUrlin interfaceSessionConfig
-
setSessionId
public void setSessionId(HttpServerExchange exchange, String sessionId)
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
public void clearSession(HttpServerExchange exchange, String sessionId)
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
public String findSessionId(HttpServerExchange exchange)
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
public SessionConfig.SessionCookieSource sessionCookieSource(HttpServerExchange exchange)
- Specified by:
sessionCookieSourcein interfaceSessionConfig
-
getName
public String getName()
- Specified by:
getNamein interfacejavax.servlet.SessionCookieConfig
-
setName
public void setName(String name)
- Specified by:
setNamein interfacejavax.servlet.SessionCookieConfig
-
getDomain
public String getDomain()
- Specified by:
getDomainin interfacejavax.servlet.SessionCookieConfig
-
setDomain
public void setDomain(String domain)
- Specified by:
setDomainin interfacejavax.servlet.SessionCookieConfig
-
getPath
public String getPath()
- Specified by:
getPathin interfacejavax.servlet.SessionCookieConfig
-
setPath
public void setPath(String path)
- Specified by:
setPathin interfacejavax.servlet.SessionCookieConfig
-
getComment
public String getComment()
- Specified by:
getCommentin interfacejavax.servlet.SessionCookieConfig
-
setComment
public void setComment(String comment)
- Specified by:
setCommentin interfacejavax.servlet.SessionCookieConfig
-
isHttpOnly
public boolean isHttpOnly()
- Specified by:
isHttpOnlyin interfacejavax.servlet.SessionCookieConfig
-
setHttpOnly
public void setHttpOnly(boolean httpOnly)
- Specified by:
setHttpOnlyin interfacejavax.servlet.SessionCookieConfig
-
isSecure
public boolean isSecure()
- Specified by:
isSecurein interfacejavax.servlet.SessionCookieConfig
-
setSecure
public void setSecure(boolean secure)
- Specified by:
setSecurein interfacejavax.servlet.SessionCookieConfig
-
getMaxAge
public int getMaxAge()
- Specified by:
getMaxAgein interfacejavax.servlet.SessionCookieConfig
-
setMaxAge
public void setMaxAge(int maxAge)
- Specified by:
setMaxAgein interfacejavax.servlet.SessionCookieConfig
-
getFallback
public SessionConfig getFallback()
-
setFallback
public void setFallback(SessionConfig fallback)
-
-