Connection Identifiers & Web Environments

When a web browser accesses a web server, it goes through the following steps:

  1. establish a connection to the server
  2. submit a request -- eg. a request for a page
  3. receive a response -- eg. the requested HTML page
  4. drop the connection

Carapace can be used to give a web interface onto existing computer systems. Many such systems require the user to logon and keep the session open until they leave.

Carapace uses a connection identifier to link web requests for URLs and a user's connection in the following manner. Once a user has been authenticated, a unique connection identifier is generated for that session. In addition, a web environment can be created to hold persistent data for the lifetime of session.

Carapace sends this connection id as a cookie to the web browser -- the browser then sends this value along with each request for a URL.

Connection Identifiers

A Carapace connection identifier is a string starting with Cara* followed by a value unique within the current process.

A new connection identifier can be created from the WebEnvironments class.

Web Environments

When evaluating an HTML Template within the CHub -- the Carapace Hub -- the received HTTP request contains a reference to the set of Web environments.


    req.environments
In addition, the HTTP request can create a new connection id as follows:

    req.environments
This returns a WebEnvironments object which can be used to create new connection ids and individual environments.


Contents Index Current topic: Carapace Hub Related topics: objects