package eliom
Install
Dune Dependency
Authors
Maintainers
Sources
md5=218bcb5cd275cc05be06574c5fa357fa
sha512=edbf8b084ec1b7439d4715199c22eb925a77a2dcfbe76bb5bbc4b9d076b70be1b0de74f9eab9dfb7854df28d65eb31a4c17380528d4a461d9c2a4222abe804cc
doc/eliom.server/Eliom_common/index.html
Module Eliom_common
Source
Low level functions for Eliom, exceptions and types.
Scopes
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 hierarchies 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).
Exception and error handling
Page not found
Service called with wrong parameter names
The service (GET or POST) parameters do not match expected type
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
.
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