Top Description Fields Constructors Methods
io.undertow.server.session

public Class SessionCookieConfig

extends Object
implements SessionConfig
Class Inheritance
All Implemented Interfaces
io.undertow.server.session.SessionConfig
Imports
io.undertow.UndertowLogger, io.undertow.server.HttpServerExchange, io.undertow.server.handlers.Cookie, .CookieImpl

Encapsulation of session cookie configuration. This removes the need for the session manager to know about cookie configuration.
Authors
Stuart Douglas, Richard Opalka

Field Summary

Modifier and TypeField and Description
private String
private String
public static final String
private boolean
private String
private boolean
private int
private String
private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
clearSession(final HttpServerExchange
The exchange
exchange
,
final String
The session id
sessionId
)

Implements io.undertow.server.session.SessionConfig.clearSession.

Clears this session from the exchange, removing the attachment and making any changes to the response necessary, such as clearing cookies.

public String
findSessionId(final HttpServerExchange
The exchange
exchange
)

Implements io.undertow.server.session.SessionConfig.findSessionId.

Retrieves a session id of an existing session from an exchange.

public String
public String
public String
public int
public String
public boolean
public boolean
public boolean
public String
rewriteUrl(final String originalUrl, final String sessionId)

Implements io.undertow.server.session.SessionConfig.rewriteUrl.

public SessionConfig.SessionCookieSource
public SessionCookieConfig
setComment(final String comment)

public SessionCookieConfig
setCookieName(final String cookieName)

public SessionCookieConfig
setDiscard(final boolean discard)

public SessionCookieConfig
setDomain(final String domain)

public SessionCookieConfig
setHttpOnly(final boolean httpOnly)

public SessionCookieConfig
setMaxAge(final int maxAge)

public SessionCookieConfig
setPath(final String path)

public SessionCookieConfig
setSecure(final boolean secure)

public void
setSessionId(final HttpServerExchange
The exchange
exchange
,
final String
The session
sessionId
)

Implements io.undertow.server.session.SessionConfig.setSessionId.

Attaches the session to the exchange.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

commentback to summary
private String comment
cookieNameback to summary
private String cookieName
DEFAULT_SESSION_IDback to summary
public static final String DEFAULT_SESSION_ID
discardback to summary
private boolean discard
domainback to summary
private String domain
httpOnlyback to summary
private boolean httpOnly
maxAgeback to summary
private int maxAge
pathback to summary
private String path
secureback to summary
private boolean secure

Constructor Detail

SessionCookieConfigback to summary
public SessionCookieConfig()

Method Detail

clearSessionback to summary
public void clearSession(final HttpServerExchange exchange, final String sessionId)

Implements io.undertow.server.session.SessionConfig.clearSession.

Doc from io.undertow.server.session.SessionConfig.clearSession.

Clears this session from the exchange, removing the attachment and making any changes to the response necessary, such as clearing cookies.

Parameters
exchange:HttpServerExchange

The exchange

sessionId:String

The session id

Annotations
@Override
findSessionIdback to summary
public String findSessionId(final HttpServerExchange exchange)

Implements io.undertow.server.session.SessionConfig.findSessionId.

Doc from io.undertow.server.session.SessionConfig.findSessionId.

Retrieves a session id of an existing session from an exchange.

Parameters
exchange:HttpServerExchange

The exchange

Returns:String

The session id, or null

Annotations
@Override
getCommentback to summary
public String getComment()
getCookieNameback to summary
public String getCookieName()
getDomainback to summary
public String getDomain()
getMaxAgeback to summary
public int getMaxAge()
getPathback to summary
public String getPath()
isDiscardback to summary
public boolean isDiscard()
isHttpOnlyback to summary
public boolean isHttpOnly()
isSecureback to summary
public boolean isSecure()
rewriteUrlback to summary
public String rewriteUrl(final String originalUrl, final String sessionId)

Implements io.undertow.server.session.SessionConfig.rewriteUrl.

Annotations
@Override
sessionCookieSourceback to summary
public SessionConfig.SessionCookieSource sessionCookieSource(HttpServerExchange exchange)

Implements io.undertow.server.session.SessionConfig.sessionCookieSource.

Annotations
@Override
setCommentback to summary
public SessionCookieConfig setComment(final String comment)
setCookieNameback to summary
public SessionCookieConfig setCookieName(final String cookieName)
setDiscardback to summary
public SessionCookieConfig setDiscard(final boolean discard)
setDomainback to summary
public SessionCookieConfig setDomain(final String domain)
setHttpOnlyback to summary
public SessionCookieConfig setHttpOnly(final boolean httpOnly)
setMaxAgeback to summary
public SessionCookieConfig setMaxAge(final int maxAge)
setPathback to summary
public SessionCookieConfig setPath(final String path)
setSecureback to summary
public SessionCookieConfig setSecure(final boolean secure)
setSessionIdback to summary
public void setSessionId(final HttpServerExchange exchange, final String sessionId)

Implements io.undertow.server.session.SessionConfig.setSessionId.

Doc from io.undertow.server.session.SessionConfig.setSessionId.

Attaches 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 findSessionId(io.undertow.server.HttpServerExchange)

Parameters
exchange:HttpServerExchange

The exchange

sessionId:String

The session

Annotations
@Override