module Model: sig .. end
Models for CGIs
type cookie_action =
| |
Set of string * string |
| |
Unset of string * string |
To set or unset a pair (name, value) in a cookie.
val html_answer : Html.html * cookie_action list -> string
html_answer (html, cookie_actions) returns the
string for a correct cgi output, with the given
HTML code and optional cookie actions.
val html_answer_f : ('a -> string) -> 'a * cookie_action list -> string
html_answer_f f (html, cookie_actions) returns the
string for a correct cgi output, apply f to html
to get the string from the html code, whatever
html really is.
Simple models
module type Cgi_model = sig .. end
module FCgi:
module Cgi: sig .. end
A basic CGI module, where HTML documents are strings, and
the callback variable name is "callback".
Models with sessions
module type Session_model = sig .. end
exception Exit_html of string * cookie_action list
This exception can be used to exit from a callback with a document.
exception Exit_handler of string * Env.cgi_env
This exception can be used to exit from a callback,
and to use another callback with the new environment and the same
optional user info.
module FCgi_session_params:
module FCgi_session_cookies:
A functor to create the module with the functions
to manage sessions between pages using cookies.