Changes

Jump to navigation Jump to search
338 bytes added ,  10:29, 3 August 2022
m
Text replacement - "8984" to "8080"
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|session:id||xs:string}}
|-valign="top"
| '''Summary'''
|Returns the session ID of a servlet request.
|-valign="top"
| '''Errors'''
|{{Error|not-found|#Errors}} No session is available for the current client.
|-valign="top"
| '''Examples'''
|Running the server-side XQuery file {{Code|id.xq}} via <code><nowiki>http://localhost:89848080/id.xq</nowiki></code>:
<syntaxhighlight lang="xquery">
import module namespace session = "http://basex.org/modules/session";
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|session:created||xs:dateTime}}
|-valign="top"
| '''Summary'''
|Returns the creation time of a session.
|-valign="top"
| '''Errors'''
|{{Error|not-found|#Errors}} No session is available for the current client.
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|session:accessed||xs:dateTime}}
|-valign="top"
| '''Summary'''
|Returns the last access time of a session.
|-valign="top"
| '''Errors'''
|{{Error|not-found|#Errors}} No session is available for the current client.
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|session:names||xs:string*}}
|-valign="top"
| '''Summary'''
|Returns the names of all attributes bound to the current session.
|-valign="top"
| '''Examples'''
|Running the server-side XQuery file {{Code|names.xq}} via <code><nowiki>http://localhost:89848080/names.xq</nowiki></code>:
<syntaxhighlight lang="xquery">
import module namespace session = "http://basex.org/modules/session";
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|session:get|$name as xs:string|item()*}}<br/>{{Func|session:get|$name as xs:string, $default as item()*|item()*}}
|-valign="top"
| '''Summary'''
|Returns the value of a session attribute with the specified <code>$name</code>. If the attribute is unknown, an empty sequence or the optionally specified {{Code|$default}} value will be returned instead.
|-valign="top"
| '''Examples'''
|Running the server-side XQuery file {{Code|get.xq}} via <code><nowiki>http://localhost:89848080/get.xq?key=user</nowiki></code>:
<syntaxhighlight lang="xquery">
import module namespace session = "http://basex.org/modules/session";
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|session:set|$name as xs:string, $value as item()*|empty-sequence()}}
|-valign="top"
| '''Summary'''
|Binds the specified {{Code|$value}} to the session attribute with the specified {{Code|$name}}.
|-valign="top"
| '''Errors'''
|{{Error|not-found|#Errors}} No session is available for the current client.
|-valign="top"
| '''Examples'''
|Running the server-side XQuery file {{Code|set.xq}} via <code><nowiki>http://localhost:89848080/set.xq?key=user&value=john</nowiki></code>:
<syntaxhighlight lang="xquery">
import module namespace session = "http://basex.org/modules/session";
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|session:delete|$name as xs:string|empty-sequence()}}
|-valign="top"
| '''Summary'''
|Deletes a session attribute with the specified <code>$name</code>.
|-valign="top"
| '''Examples'''
|Running the server-side XQuery file {{Code|delete.xq}} via <code><nowiki>http://localhost:89848080/delete.xq?key=user</nowiki></code>:
<syntaxhighlight lang="xquery">
import module namespace session = "http://basex.org/modules/session";
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|session:close||empty-sequence()}}
|-valign="top"
| '''Summary'''
|Unregisters a session and all data associated with it.
! width="110"|Code
|Description
|-valign="top"
|{{Code|not-found}}
|No session is available for the current client.
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu