Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package io.undertow.server.session;
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.

Stuart Douglas
public interface SessionConfig {
    AttachmentKey<SessionConfigATTACHMENT_KEY = AttachmentKey.create(SessionConfig.class);

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)

exchange The exchange
sessionId The session
    void setSessionId(final HttpServerExchange exchangefinal String sessionId);

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

exchange The exchange
sessionId The session id
    void clearSession(final HttpServerExchange exchangefinal String sessionId);

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

exchange The exchange
The session id, or null
    String findSessionId(final HttpServerExchange exchange);
    String rewriteUrl(final String originalUrlfinal String sessionId);
    enum SessionCookieSource {
New to GrepCode? Check out our FAQ X