public class Session extends Object
Sessions persist between HTTP requests for a single browser session. They are deleted when the browser is closed, or they time-out. Session cookies are used to maintain sessions using a secure UUID.
Sessions can be used to maintain data for a browser session, e.g. a shopping basket.
The context must have first been routed to a SessionHandler
for sessions to be available.
original
non RX-ified interface using Vert.x codegen.Modifier and Type | Method and Description |
---|---|
void |
destroy()
Destroy the session
|
<T> T |
get(String key)
Get some data from the session
|
Object |
getDelegate() |
String |
id() |
boolean |
isDestroyed() |
long |
lastAccessed() |
static Session |
newInstance(Session arg) |
Session |
put(String key,
Object obj)
Put some data in a session
|
<T> T |
remove(String key)
Remove some data from the session
|
void |
setAccessed()
Mark the session as being accessed.
|
long |
timeout() |
public Session(Session delegate)
public Object getDelegate()
public String id()
public Session put(String key, Object obj)
key
- the key for the dataobj
- the datapublic <T> T get(String key)
key
- the key of the datapublic <T> T remove(String key)
key
- the key of the datapublic long lastAccessed()
public void destroy()
public boolean isDestroyed()
public long timeout()
public void setAccessed()
Copyright © 2016. All rights reserved.