Changes

Jump to navigation Jump to search
13 bytes removed ,  13:29, 11 July 2019
=Conventions=
* The module will be available if the {{Code|basex-api}} package must be included library is found in the classpath. This is always the case if you use one of the complete distributions of BaseX (zip, exe, war) of BaseX.* All functions and errors are assigned to the <code><nowiki>http://basex.org/modules/session</nowiki></code> namespace, which is statically bound to the {{Code|session}} prefix. The Prior to {{Version|9.2}}, the module must needed to be imported in the query prolog:
<pre class="brush:xquery">
import module namespace session = "http://basex.org/modules/session";
...
</pre>
* In this documentation, the namespace is bound to the {{Code|session}} prefix.* Errors are assigned to the <code><nowiki>http://basex.org/errors</nowiki></code> namespace, which is statically bound to the {{Code|bxerr}} prefix.* If any of the functions is called outside the servlet context, the error {{Error|BXSE0003|<code>[[XQuery Errors#BaseX Errors}} |basex:http]]</code> is raised.* As sessions are side-effecting operations, all functions are flagged as ''non-deterministic''. This means that the functions As a result, some query optimizations will not be reordered by the compilersuppressed.
=Functions=
==session:id==
 
{| width='100%'
|-
==session:created==
 
{| width='100%'
|-
==session:accessed==
 
{| width='100%'
|-
==session:names==
 
{| width='100%'
|-
|-
| '''Summary'''
|Returns the names of all variables attributes bound to the current session.
|-
| '''Examples'''
==session:get==
 
{{Mark|Updated with Version 9.3:}} Values that have no XQuery type will be returned as strings.
 
{| width='100%'
|-
|-
| '''Summary'''
|Returns the value of a session attribute with the specified <code>$name</code> bound to the current session. If the specified variable attribute is unknown, an empty sequence or the optionally specified default value is returned instead.|-| '''Errors'''|{{ErrorCode|BXSE0002|#Errors$default}} the value of a session variable could not will be retrievedreturned instead.
|-
| '''Examples'''
|-
| width='120' | '''Signatures'''
|{{Func|session:set|$key name as xs:string, $value as item()*|empty-sequence()}}
|-
| '''Summary'''
|Binds the specified key/{{Code|$value pair }} to a the sessionattribute with the specified {{Code|$name}}.
|-
| '''Errors'''
|{{Error|BXSE0001set|#Errors}} a function item was specified as The supplied value of a session variablecannot be materialized.
|-
| '''Examples'''
==session:delete==
 
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|session:delete|$key name as xs:string|empty-sequence()}}
|-
| '''Summary'''
|Deletes a session variableattribute with the specified <code>$name</code>.
|-
| '''Examples'''
==session:close==
 
{| width='100%'
|-
|Description
|-
|{{Code|BXSE0001set}}|A function item was specified as The supplied value of a session attribute.|-|{{Code|BXSE0002}}|An error occurred while retrieving the value of a session attribute.|-|{{Code|BXSE0003}}|A function was called outside the servlet contextcannot be materialized.
|}
=Changelog=
 
;Version 9.3
 
* Updated: [[#session:get|session:get]]: Values that have no XQuery type will be returned as strings.
 
;Version 9.0
 
* Updated: error codes updated; errors now use the module namespace
;Version 8.0
 
* Updated: Allow sequences as session values.
This module was introduced with Version 7.5.
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu