new SessionStore()
A session store is used to store sessions for an Vert.x-Web web app
- Source:
Methods
clear(resultHandler)
Remove all sessions from the store.
Parameters:
| Name | Type | Description |
|---|---|---|
resultHandler |
function | will be called with a success or a failure |
- Source:
close()
Close the store
- Source:
createSession(timeout, length) → {Session}
Create a new session.
Parameters:
| Name | Type | Description |
|---|---|---|
timeout |
number | the session timeout, in ms |
length |
number | the required length for the session id |
- Source:
Returns:
the session
- Type
- Session
delete(id, resultHandler)
Delete the session with the specified ID.
Parameters:
| Name | Type | Description |
|---|---|---|
id |
string | the session id |
resultHandler |
function | will be called with a success or a failure |
- Source:
get(cookieValue, resultHandler)
Get the session with the specified ID.
Parameters:
| Name | Type | Description |
|---|---|---|
cookieValue |
string | the unique ID of the session |
resultHandler |
function | will be called with a result holding the session, or a failure |
- Source:
init(vertx, options) → {SessionStore}
Initialize this store.
Parameters:
| Name | Type | Description |
|---|---|---|
vertx |
Vertx | the vertx instance |
options |
Object | optional Json with extra configuration options |
- Source:
Returns:
self
- Type
- SessionStore
put(session, resultHandler)
Add a session with the specified ID.
Parameters:
| Name | Type | Description |
|---|---|---|
session |
Session | the session |
resultHandler |
function | will be called with a success or a failure |
- Source:
retryTimeout() → {number}
The retry timeout value in milli seconds used by the session handler when it retrieves a value from the store.
A non positive value means there is no retry at all.
- Source:
Returns:
the timeout value, in ms
- Type
- number
size(resultHandler)
Get the number of sessions in the store.
Beware of the result which is just an estimate, in particular with distributed session stores.
Parameters:
| Name | Type | Description |
|---|---|---|
resultHandler |
function | will be called with the number, or a failure |
- Source: