Module Eliom_state.Ext
exception Wrong_scopeException raised when you try to access a reference belonging to a scope different to the state's scope
type timeout = | TGlobal(*see global setting
*)| TNone(*explicitly set no timeout
*)| TSome of float(*timeout duration in seconds
*)
Type used to describe session timeouts
These types are used to get or set information about browser or process cookies (like timeouts).
type service_cookie_infotype data_cookie_infotype persistent_cookie_infotype (+'a, +'b) stateThe type of states. The first parameter corresponds to the scope level and the second one to the kind of state (volatile or persistent data, or service state)
val volatile_data_group_state :
?scope:Eliom_common.session_group_scope ->
string ->
([> `Session_group ], [> `Data ]) statevolatile_data_group_state ~scope n returns the state corresponding to the group named n in scope scope.
val persistent_data_group_state :
?scope:Eliom_common.session_group_scope ->
string ->
([> `Session_group ], [> `Pers ]) stateSame for persistent data
val service_group_state :
?scope:Eliom_common.session_group_scope ->
string ->
([> `Session_group ], [> `Service ]) stateSame for services
val current_volatile_data_state :
?secure:bool ->
?scope:Eliom_common.user_scope ->
unit ->
([< Eliom_common.user_level ], [< `Data ]) statecurrent_volatile_data_state ~scope returns the state corresponding to scope scope. Raises Not_found if not connected or if no session group is set, or Eliom_common.Eliom_Session_expired if a cookie was present but expired.
val current_persistent_data_state :
?secure:bool ->
?scope:Eliom_common.user_scope ->
unit ->
([< Eliom_common.user_level ], [< `Pers ]) state Lwt.tSame for persistent data
val current_service_state :
?secure:bool ->
?scope:Eliom_common.user_scope ->
unit ->
([< Eliom_common.user_level ], [< `Service ]) stateSame for services
Discard external states. See fold_volatile_sub_states for explanation about the ?sitedata parameter.
val fold_volatile_sub_states :
?sitedata:Eliom_common.sitedata ->
state:([< `Session_group | `Session ], [< `Data | `Service ] as 'k) state ->
('a -> ([< `Session | `Client_process ], 'k) state -> 'a) ->
'a ->
'aFold all sessions in a groups, or all client processes in a session. If you do not call the function during a request or during the initialisation phase of the Eliom module, you must provide the extra parameter ?sitedata, that you can get by calling Eliom_request_info.get_sitedata during the initialisation phase of the Eliom module.
val iter_volatile_sub_states :
?sitedata:Eliom_common.sitedata ->
state:([< `Session_group | `Session ], [< `Data | `Service ] as 'k) state ->
(([< `Session | `Client_process ], 'k) state -> unit) ->
unitIter on all sessions in a groups, or all client processes in a session. See fold_volatile_sub_states for explanation about the ?sitedata parameter.
val fold_sub_states :
?sitedata:Eliom_common.sitedata ->
state:
([< `Session_group | `Session ], [< `Data | `Pers | `Service ] as 'k) state ->
('a -> ([< `Session | `Client_process ], 'k) state -> 'a Lwt.t) ->
'a ->
'a Lwt.tFold all sessions in a groups, or all client processes in a session (volatile and persistent). See fold_volatile_sub_states for explanation about the ?sitedata parameter.
val iter_sub_states :
?sitedata:Eliom_common.sitedata ->
state:([< `Session_group | `Session ], 'k) state ->
(([< `Session | `Client_process ], 'k) state -> unit Lwt.t) ->
unit Lwt.tIter on all sessions in a groups, or all client processes in a session (volatile and persistent). See fold_volatile_sub_states for explanation about the ?sitedata parameter.
module Low_level : sig ... endFunctions to access table data. Prefer using Eliom references.
val get_service_cookie_info :
?sitedata:Eliom_common.sitedata ->
([< Eliom_common.cookie_level ], [ `Service ]) state ->
service_cookie_infoGet the infomration about cookies (timeouts, etc.). See fold_volatile_sub_states for explanation about the ?sitedata parameter.
val get_volatile_data_cookie_info :
?sitedata:Eliom_common.sitedata ->
([< Eliom_common.cookie_level ], [ `Data ]) state ->
data_cookie_infoSee fold_volatile_sub_states for explanation about the ?sitedata parameter.
val get_persistent_cookie_info :
([< Eliom_common.cookie_level ], [ `Pers ]) state ->
persistent_cookie_info Lwt.tval get_service_cookie_scope :
cookie:service_cookie_info ->
Eliom_common.user_scopeval get_volatile_data_cookie_scope :
cookie:data_cookie_info ->
Eliom_common.user_scopeval get_persistent_data_cookie_scope :
cookie:persistent_cookie_info ->
Eliom_common.user_scopeval set_service_cookie_timeout :
cookie:service_cookie_info ->
float option ->
unitval set_volatile_data_cookie_timeout :
cookie:data_cookie_info ->
float option ->
unitval set_persistent_data_cookie_timeout :
cookie:persistent_cookie_info ->
float option ->
unit Lwt.tval get_service_cookie_timeout : cookie:service_cookie_info -> timeoutval get_volatile_data_cookie_timeout : cookie:data_cookie_info -> timeoutval get_persistent_data_cookie_timeout :
cookie:persistent_cookie_info ->
timeoutval unset_service_cookie_timeout : cookie:service_cookie_info -> unitval unset_volatile_data_cookie_timeout : cookie:data_cookie_info -> unitval unset_persistent_data_cookie_timeout :
cookie:persistent_cookie_info ->
unit Lwt.tval get_session_group_list : unit -> string listReturns a list containing the names of all session group that are available for this site.
val iter_service_cookies : (service_cookie_info -> unit Lwt.t) -> unit Lwt.tIterator on all active service cookies. Lwt.pause is called automatically after each iteration.
val iter_volatile_data_cookies : (data_cookie_info -> unit Lwt.t) -> unit Lwt.tIterator on data cookies. Lwt.pause is called automatically after each iteration.
val iter_persistent_data_cookies :
(persistent_cookie_info -> unit Lwt.t) ->
unit Lwt.tIterator on persistent cookies. Lwt.pause is called automatically after each iteration.
val fold_service_cookies :
(service_cookie_info -> 'b -> 'b Lwt.t) ->
'b ->
'b Lwt.tIterator on service cookies. Lwt.pause is called automatically after each iteration.
val fold_volatile_data_cookies :
(data_cookie_info -> 'b -> 'b Lwt.t) ->
'b ->
'b Lwt.tIterator on data cookies. Lwt.pause is called automatically after each iteration.
val fold_persistent_data_cookies :
(persistent_cookie_info -> 'b -> 'b Lwt.t) ->
'b ->
'b Lwt.tIterator on persistent cookies. Lwt.pause is called automatically after each iteration.