public class SessionHandler extends Object implements Handler<RoutingContext>
Session for each browser session.
It looks up the session for each request based on a session cookie which contains a session ID. It stores the session when the response is ended in the session store.
The session is available on the routing context with .
The session handler requires a CookieHandler to be on the routing chain before it.
original non RX-ified interface using Vert.x codegen.| Constructor and Description |
|---|
SessionHandler(SessionHandler delegate) |
| Modifier and Type | Method and Description |
|---|---|
static SessionHandler |
create(SessionStore sessionStore)
Create a session handler
|
Object |
getDelegate() |
void |
handle(RoutingContext arg0)
Something has happened, so handle it.
|
static SessionHandler |
newInstance(SessionHandler arg) |
SessionHandler |
setCookieHttpOnlyFlag(boolean httpOnly)
Sets whether the 'HttpOnly' flag should be set for the session cookie.
|
SessionHandler |
setCookieSecureFlag(boolean secure)
Sets whether the 'secure' flag should be set for the session cookie.
|
SessionHandler |
setNagHttps(boolean nag)
Set whether a nagging log warning should be written if the session handler is accessed over HTTP, not
HTTPS
|
SessionHandler |
setSessionCookieName(String sessionCookieName)
Set the session cookie name
|
SessionHandler |
setSessionTimeout(long timeout)
Set the session timeout
|
public SessionHandler(SessionHandler delegate)
public Object getDelegate()
public void handle(RoutingContext arg0)
Handlerhandle in interface Handler<RoutingContext>arg0 - the event to handlepublic static SessionHandler create(SessionStore sessionStore)
sessionStore - the session storepublic SessionHandler setSessionTimeout(long timeout)
timeout - the timeout, in ms.public SessionHandler setNagHttps(boolean nag)
nag - true to nagpublic SessionHandler setCookieSecureFlag(boolean secure)
secure - true to set the secure flag on the cookiepublic SessionHandler setCookieHttpOnlyFlag(boolean httpOnly)
httpOnly - true to set the HttpOnly flag on the cookiepublic SessionHandler setSessionCookieName(String sessionCookieName)
sessionCookieName - the session cookie namepublic static SessionHandler newInstance(SessionHandler arg)
Copyright © 2015. All rights reserved.