5.2.2 pse.plugins.client -- information about the browser/client

Generally speaking you can get all the client information you want from CGI variables, which are available in the pse.plugins.request module. The pse.plugins.client module gives you an easier and programmatically clearer way to access that information. Additionally, the pse.plugins.client provides an interface to manage cookies maintained by the browser.

address
A tuple of the remote IP address and the port.

class CookieClass( name, value, path, expires)
name is the name used for the cookie , and value is the value to set. The path argument defaults to '/'. The expires argument is the number of seconds the cookie should live, and a value of None (default) indicated that the cookie should live only for the current browsing session.

A CookieClass object has the attributes name, value, path, expires and modified. Only value, path, and expires are writable. To discard a cookie, set expires to 0. To rename a cookie, discard it and create a new CookieClass.

Note: In versions prior to 3.0, CookieClass was named CookieDef, but since the class itself was not exposed to create new cookies, it shoudn't pose any upgrading problems.

New in version 3.0.

cookies
A dictionary containing CookieClass objects (see above). Upon initialization, the cookies dictionary contains all cookies that were sent from the browser. Since the browser does not specify the expiration of the cookie, the expires attribute will be initially set to None. The keys correspond to the cookie names provided by the browser. New cookies do not have to match the key, so duplicate cookie names can be created with different paths.

Only cookies that have been modified are sent back to the browser at the end of the request. Therefore, if you modify a cookie sent by the browser, you should also alter the expires value, unless the cookie is to be discarded at the end of the browsing session.

Note: In versions prior to 3.0, CookieClass was named CookieDef, but its interface was not available so that you could actually create new cookies. This has been fixed for 3.0, as well as a name change. Since the class itself was not exposed to create new cookies, it shoudn't pose any upgrading problems.

New in version 2.0.

Changed in version 3.0.

ip
Similar to address, but it is a string containing only the IP address.

ident
A string containing information obtained from the client using RFC1413 ident, if available.

password
If an authorization challenge was issued for the request, then this is the password the user entered.

user_agent
This is the browser's User Agent string. Note that this can be spoofed by some browsers.

username
If an authorization challenge was issued for the request, then this is the username the user entered.