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 RoutingContext.session().
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 |
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 setSessionCookieName(String sessionCookieName)
sessionCookieName - the session cookie namepublic static SessionHandler newInstance(SessionHandler arg)
Copyright © 2015. All Rights Reserved.