This module implements the cookie hooks called from http_open/3, adding
cookie handling to the client.
This library supports a notion of clients. A client is a (ground) term
to which a cookie database is connected. This allows a single Prolog
process to act as multiple clients. The default client is called
default. Use the option
client(+ClientId) to select another client.
The client and cookie database can be inspected and cleared using these
- To be done
- - add hooks to http_get/3 and http_post/4
- http:write_cookies(+Out, +Parts, +Options) is det[multifile]
- Emit a cookie header for the current request.
- cookie(+ClientId, +Parts, -Cookie) is semidet[private]
- Cookie is the cookie for Parts for the given ClientId
- cookie_value(+NameValueList, -CookieString) is det[private]
- Create a cookie value string with name=value, seperated by ";".
- http:update_cookies(+CookieData, +Parts, +Options) is semidet[multifile]
- Update the client cookie database.
- remove_cookies(+ClientId, +Host, +Path, +Name, +SetOptions) is det[private]
- Remove all cookies that conflict with the new set-cookie
- current_cookie(+ClientId, +Host, +Path, -Name, -Value) is nondet[private]
- Find cookies that match the given request.
- cookie_remove_client(+ClientId) is det
- Fake user quitting a browser. Removes all cookies that do
not have an expire date.
- cookie_remove_all_clients is det
- Simply logout all clients. See http_remove_client/1.
- current_client(?ClientId) is nondet[private]
- True if ClientId is the identifier of a client.
- http_current_cookie(?ClientId, ?Name, ?Value, ?Options) is nondet[private]
- Query current cookie database. If Name is given, it is matched
case insensitive against the known cookies. If it is unbound,
the cookie name is returned in its oiginal case (case
The following predicates are exported, but not or incorrectly documented.
- cookie_current_cookie(Arg1, Arg2, Arg3, Arg4)