A RESTful browser for eXist Java-Based Function Modules


http://exist-db.org/xquery/session
A module for dealing with the HTTP session.

session:clear() empty()
Removes all attributes from the current HTTP session. Does NOT invalidate the session.

session:create() empty()
Initialize an HTTP session if not already present

session:encode-url($url as xs:anyURI) xs:anyURI
Encodes the specified URL with the current HTTP session-id.
$urlThe URL to encode

Returns the encoded URL

session:exists() xs:boolean
Returns whether a session object exists.

Returns true if the session object exists

session:get-attribute($name as xs:string) xs:string*
Returns an attribute stored in the current session object or an empty sequence if the attribute cannot be found.
$nameThe session attribute name

Returns the attribute value

session:get-attribute-names() xs:string*
Returns a sequence containing the names of all session attributes defined within the current HTTP session.

Returns the list of attribute names

session:get-id() xs:string?
Returns the ID of the current session or an empty sequence if there is no session.

Returns the session ID

session:invalidate() empty()
Invalidate (remove) the current HTTP session if present

session:remove-attribute($name as xs:string) empty()
Removes the attribute with the supplied name from the current session
$nameThe attribute name

session:set-attribute($name as xs:string, $value as item()*) empty()
Stores a value in the current session using the supplied attribute name. If no session exists, then one will be created.
$nameThe attribute name
$valueThe value to be stored in the session by the attribute name

session:set-current-user($user-name as xs:string, $password as xs:string) xs:boolean?
Change the user identity for the current HTTP session. Subsequent XQueries in the session will run with the new user identity.
$user-nameThe user name
$passwordThe password

Returns true if the user name and password represent a valid user
Return to list of all modules