import module namespace session = "http://basex.org/modules/session";
session:update-attribute($key, $value), 'Attribute was set.'
</pre>
|}
==session:delete-attribute==
{| width='100%'
|-
| width='90' | '''Signatures'''
|{{Func|session:delete-attribute|$key as xs:string|empty-sequence()}}
|-
| '''Summary'''
|Deletes a session attribute.
|-
| '''Properties'''
|The function is ''non-deterministic'': evaluation order will be preserved by the compiler.
|-
| '''Errors'''
|{{Error|BXSE0001|#Errors}} a function item was specified as value of a session attribute.
|-
| '''Examples'''
|Running the server-side XQuery file {{Code|delete.xq}} via <code><nowiki>http://localhost:8984/delete.xq?key=user</nowiki></code>:
<pre class="brush:xquery">
import module namespace session = "http://basex.org/modules/session";
session:delete-attribute($key), 'Attribute was deleted.'
</pre>
|}