XQuery Function Documentation
http://exist-db.org/xquery/session
java:org.exist.xquery.functions.session.SessionModule
A module for dealing with the HTTP session.
session:clear
Removes all attributes from the current HTTP session. Does NOT invalidate the session.
- Returns:
- xs:string
session:create
Initialize an HTTP session if not already present
- Returns:
- item()
session:encode-url
Encodes the specified URL with the current HTTP session-id.
- Parameters:
-
$url The URL to encode - Returns:
- xs:anyURI : the encoded URL
session:exists
Returns whether a session object exists.
- Returns:
- xs:boolean : true if the session object exists
session:get-attribute
Returns an attribute stored in the current session object or an empty sequence if the attribute cannot be found.
- Parameters:
-
$name The session attribute name - Returns:
- item()* : the attribute value
session:get-attribute-names
Returns a sequence containing the names of all session attributes defined within the current HTTP session.
- Returns:
- xs:string* : the list of attribute names
session:get-creation-time
Returns the time when this session was created. If a session does not exist, a new one is created. If the session is already invalidated, it returns January 1, 1970 GMT
- Returns:
- xs:dateTime : the date-time when the session was created
session:get-id
Returns the ID of the current session or an empty sequence if there is no session.
- Returns:
- xs:string? : the session ID
session:get-last-accessed-time
Returns the last time the client sent a request associated with this session. If a session does not exist, a new one is created. Actions that your application takes, such as getting or setting a value associated with the session, do not affect the access time. If the session is already invalidated, it returns January 1, 1970 GMT
- Returns:
- xs:dateTime : the date-time when the session was last accessed
session:get-max-inactive-interval
Returns the maximum time interval, in seconds, that the servlet container will keep this session open between client accesses. After this interval, the servlet container will invalidate the session. The maximum time interval can be set with the session:set-max-inactive-interval function. A negative time indicates the session should never timeout.
- Returns:
- xs:int : the maximum time interval, in seconds
session:invalidate
Invalidate (remove) the current HTTP session if present
- Returns:
- item()
session:remove-attribute
Removes the attribute with the supplied name from the current session
- Parameters:
-
$name The attribute name - Returns:
- item()
session:set-attribute
Stores a value in the current session using the supplied attribute name. If no session exists, then one will be created.
- Parameters:
-
$name The attribute name $value* The value to be stored in the session by the attribute name - Returns:
- item()
session:set-current-user
Change the user identity for the current HTTP session. Subsequent XQueries in the session will run with the new user identity.
- Parameters:
-
$user-name The user name $password The password - Returns:
- xs:boolean? : true if the user name and password represent a valid user
session:set-max-inactive-interval
Sets the maximum time interval, in seconds, that the servlet container will keep this session open between client accesses. After this interval, the servlet container will invalidate the session. A negative time indicates the session should never timeout.
- Parameters:
-
$interval The maximum inactive interval (in seconds) before closing the session - Returns:
- item()