{{Mark|Updated with Version 9.3:}} Values that have no XQuery type will be returned as strings.
{| 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>:
|{{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|set|#Errors}} The supplied value cannot be materialized.<br/>{{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>: