module FCgi_session_cookies:
A functor to create the module with the functions
to manage sessions between pages using cookies.
type user = M.t
type html = M.html
type session_id = M.session_id
type callback = Env.cgi_env ->
user option -> html
A callback is a function to call for a given page.
The function takes
- the environment,
- an option pair
(user, sid) if the user is identified
(with a session), then sid is the sessions id,
Then the function returns an HTML document.
type cookie_callback = Env.cgi_env ->
user option ->
html * Model.cookie_action list
val session_id : Env.cgi_env -> session_id option
Get the session id, if the user is connected.
val register : string -> callback -> unit
Register a callback.
val cookie_register : string -> cookie_callback -> unit
Register a cookie_callback.
val arg_of_callback : string -> string
Take a page name and build the code to append to an url
to go to this callback.
val main : default:cookie_callback -> unit
USe the required callback (according to the value of the variable
for the callback in the url. This is the function to call at the end
of the program. The default callback is given in argument.