---
name: "Eliom_common.server"
section: "3o"
platform: "linux"
package: "libeliom-ocaml-doc"
version: "4.0.0-2"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/Eliom_common.server"
---

# Eliom\_common.server(3o)

Low level functions for Eliom, exceptions and types.

## NAME

Eliom\_common - Low level functions for Eliom, exceptions and types.

## Module

Module   Eliom\_common

## Documentation

Module **Eliom\_common**\
  :  **sig end**

Low level functions for Eliom, exceptions and types.

*type scope\_hierarchy* =  **Eliom\_common\_base.scope\_hierarchy**

**Scopes**

*type cookie\_scope* =  **\[ \`Client\_process of scope\_hierarchy** **\| \`Session of scope\_hierarchy \]**

*type user\_scope* =  **\[ \`Client\_process of scope\_hierarchy** **\| \`Session of scope\_hierarchy** **\| \`Session\_group of scope\_hierarchy \]**

*type scope* =  **\[ \`Client\_process of scope\_hierarchy** **\| \`Session of scope\_hierarchy** **\| \`Session\_group of scope\_hierarchy** **\| \`Site \]**

*type all\_scope* =  **\[ \`Client\_process of scope\_hierarchy** **\| \`Global** **\| \`Request** **\| \`Session of scope\_hierarchy** **\| \`Session\_group of scope\_hierarchy** **\| \`Site \]**

*type cookie\_level* =  **\[ \`Client\_process \| \`Session \]**

*type user\_level* =  **\[ \`Client\_process \| \`Session \| \`Session\_group \]**

*val cookie\_scope\_of\_user\_scope* :  **\[\< user\_scope \] -\> \[\> cookie\_scope \]**

*val cookie\_level\_of\_user\_scope* :  **\[\< user\_scope \] -\> \[\> cookie\_level \]**

*val level\_of\_user\_scope* :  **\[\< user\_scope \] -\> \[\> user\_level \]**

*type global\_scope* =  **\[ \`Global \]**

Eliom is using regular (browser) cookies but can also use its own browser tab cookies (only if you are using a client side Eliom application).

It is possible to define Eliom references or services for one (browser) session, for one tab, or for one group of sessions.

Using  **\`Global** scope means you want the data or service to be available to any client.  **\`Site** is limited to current sub-site (if you have several sites on the same server).

If you want to restrict the visibility of an Eliom reference or a service: \* to a browser session, use  **~scope:Eliom\_common.default\_session\_scope** , \* to a group of sessions, use  **~scope:Eliom\_common.default\_group\_scope** , \* to a client process, use  **~scope:Eliom\_common.default\_process\_scope** . If you have a client side Eliom program running, and you want to restrict the visibility of the service to this instance of the program, use  **~scope:Eliom\_common.default\_process\_scope** .

You can create new scope hierachies with  **Eliom\_common.create\_scope\_hierarchy** . Thus it is possible to have for example several sessions that can be opened or closed independently. They use different cookies.

Secure scopes are associated to secure cookies (that is, cookies sent by browsers only if the protocol is https).

*type site\_scope* =  **\[ \`Site \]**

*type session\_group\_scope* =  **\[ \`Session\_group of scope\_hierarchy \]**

*type session\_scope* =  **\[ \`Session of scope\_hierarchy \]**

*type client\_process\_scope* =  **\[ \`Client\_process of scope\_hierarchy \]**

*type request\_scope* =  **\[ \`Request \]**

*val global\_scope* :  **global\_scope**

*val site\_scope* :  **site\_scope**

*val default\_group\_scope* :  **session\_group\_scope**

*val default\_session\_scope* :  **session\_scope**

*val default\_process\_scope* :  **client\_process\_scope**

*val comet\_client\_process\_scope* :  **client\_process\_scope**

*val request\_scope* :  **request\_scope**

*val create\_scope\_hierarchy* :  **string -\> scope\_hierarchy**

*val list\_scope\_hierarchies* :  **unit -\> scope\_hierarchy list**

**===** **Exception and error handling** **===**

*exception Eliom\_404*

Page not found

*exception Eliom\_Wrong\_parameter*

Service called with wrong parameter names

*exception Eliom\_Session\_expired*

*exception Eliom\_Typing\_Error* **of** **(string \* exn) list**

The service (GET or POST) parameters do not match expected type

*exception Eliom\_site\_information\_not\_available* **of** **string**

That function cannot be used when the site information is not available, that is, outside a request or the initialisation phase of your Eliom module (while reading the configuration file).

In particular, you cannot use the function before the configuration file is read for example when you are using static linking. In that case you must delay the function call using  **Eliom\_service.register\_eliom\_module** .

*type full\_state\_name* =  **user\_scope \* bool \* string**

*module Full\_state\_name\_table :* **sig end**

*val eliom\_link\_too\_old* :  **bool Polytables.key**

If present and true in request data, it means that the previous coservice does not exist any more

*val eliom\_service\_session\_expired* :  **(full\_state\_name list \* full\_state\_name list)** **Polytables.key**

If present in request data, means that the service session cookies does not exist any more. The string lists are the list of names of expired sessions
