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

public Interface SessionConfig

Known Direct Implementers
io.undertow.server.session.SessionCookieConfig, io.undertow.server.session.SslSessionConfig, io.undertow.server.session.PathParameterSessionConfig
Imports
io.undertow.server.HttpServerExchange, io.undertow.util.AttachmentKey

Interface that abstracts the process of attaching a session to an exchange. This includes both the HTTP side of attachment such as setting a cookie, as well as actually attaching the session to the exchange for use by later handlers.

Generally this will just set a cookie.

Author
Stuart Douglas

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum

Field Summary

Modifier and TypeField and Description
public static final AttachmentKey<SessionConfig>

Method Summary

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

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

public String

Returns:

The session id, or null
findSessionId
(final HttpServerExchange
The exchange
exchange
)

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

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

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

Attaches the session to the exchange.

Field Detail

ATTACHMENT_KEYback to summary
public static final AttachmentKey<SessionConfig> ATTACHMENT_KEY

Method Detail

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

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

findSessionIdback to summary
public String findSessionId(final HttpServerExchange exchange)

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

Parameters
exchange:HttpServerExchange

The exchange

Returns:String

The session id, or null

rewriteUrlback to summary
public String rewriteUrl(final String originalUrl, final String sessionId)
sessionCookieSourceback to summary
public SessionConfig.SessionCookieSource sessionCookieSource(final HttpServerExchange exchange)
setSessionIdback to summary
public void setSessionId(final HttpServerExchange exchange, final String sessionId)

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

io.undertow.server.session back to summary

public final Enum SessionConfig.SessionCookieSource

extends Enum<SessionConfig.SessionCookieSource>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final SessionConfig.SessionCookieSource
public static final SessionConfig.SessionCookieSource
public static final SessionConfig.SessionCookieSource
public static final SessionConfig.SessionCookieSource
public static final SessionConfig.SessionCookieSource

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static SessionConfig.SessionCookieSource
public static SessionConfig.SessionCookieSource[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

COOKIEback to summary
public static final SessionConfig.SessionCookieSource COOKIE
NONEback to summary
public static final SessionConfig.SessionCookieSource NONE
OTHERback to summary
public static final SessionConfig.SessionCookieSource OTHER
SSLback to summary
public static final SessionConfig.SessionCookieSource SSL
URLback to summary
public static final SessionConfig.SessionCookieSource URL

Constructor Detail

SessionCookieSourceback to summary
private SessionCookieSource()

Method Detail

valueOfback to summary
public static SessionConfig.SessionCookieSource valueOf(String name)
valuesback to summary
public static SessionConfig.SessionCookieSource[] values()