The Carapace Hub uses a WebEnvironments
object to hold information about HTTP sessions. This information
is available for access by scripts processed within
the HTML Templates.
Within a template, the environments are held as a property of the incoming
HttpRequest as follows:
This returns an object of type WebEnvironments.
req.environments
Once available, this object is accessed via its methods.
The WebEnvironments object supports the following methods:
| method name | description |
|---|---|
createId |
create a new connection id for an environment |
create |
create a new environment |
get |
get a particular environment as identified by its connection id |
remove |
remove a given environment |
cleanup |
remove out-of-date environments -- ie. ones which were last accessed before the supplied threshold |
createIdCreate a new connection id for an environment.
Arguments: none
Return type: String
createCreate a new environment for the supplied connection id.
Arguments:
| connectionId | String |
Return type: WebEnvironment
getGet a particular environment as identified by its connection id.
The return value is a List of two items:
Arguments:
| connectionId | String |
Return type: List
removeRemove the identified environment.
Arguments:
| connectionId | String |
Return type: Object
cleanupRemove out-of-date environments -- ie. ones which were last accessed before the supplied threshold.
Arguments:
| threshold | Integer |
Return type: the empty List
| Contents | Index | Current topic: Carapace Hub | Related topics: objects |