$Session Close: Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Created page with "{{DISPLAYTITLE:$Session_Close}} <span class="pageSubtitle"><section begin="desc" />Close an open session<section end="desc" /></span> <p class="warning">Most Sirius $functions h...")
 
m (misc cleanup)
 
(46 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:$Session_Close}}
{{DISPLAYTITLE:$Session_Close}}
<span class="pageSubtitle"><section begin="desc" />Close an open session<section end="desc" /></span>
<span class="pageSubtitle">Close an open session</span>


<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $Session_Close function is [[to be entered]].</p>
<p class="warn"><b>Note: </b>Many $functions have been deprecated in favor of Object Oriented methods. There is no direct OO equivalent for the $Session_Close function.</p>


$Session_Close closes an open session, accepts three arguments and returns a zero, indicating success, or a number indicating the cause of error, if there is one.  
<var>$Session_Close</var> closes an open [[Sessions|session]], accepts three arguments and returns a zero, indicating success, or a number indicating the cause of error, if there is one.  


The first argument is new id to be given to the session being closed. This is an optional argument and if not specified leaves the session's id unchanged.  
==Syntax==
<p class="syntax"><span class="term">%rc</span> = <span class="literal">$Session_Close</span>([<span class="term">sesid</span>], [<span class="term">owner</span>], [<span class="term">timeout</span>])
</p>
 
===Syntax terms===
<table>
<tr><th>%rc</th>
<td>A numeric value set to 0 or to an error indicator. See [[#Status codes|Status codes]], below.</td></tr>


The second argument is the userid that is to be set as the new owner of the session being closed. An '''owner''' of "*" means that the session is public, that is available to all users. Only a system administrator can create a non-public session for a user other than itself. This is an optional argument and if not specified leaves the session's owner unchanged.  
<tr><th>sesid</th>
<td>A new ID to be given to the session being closed. This is an optional argument which if not specified leaves the session's ID unchanged. </td></tr>


The third argument is the new value to be used as the session timeout value, that is the time after which the session is considered '''timed-out''', that is eligible for deletion. A value of -1 means to use the SRSDEFTO parameter value. This is an optional argument and if not specified leaves the session's timeout value unchanged.
<tr><th>owner</th>
==Syntax==
<td>The userid that is to be set as the new owner of the session being closed. An <var class="term">owner</var> value of <code>*</code> means that the session is public, that is available to all users. Only a system administrator can create a non-public session for a user other than itself.
<p class="syntax"><section begin="syntax" /> %RC = $Session_Close(sesid, owner, timeout)
<p>
<section end="syntax" /></p>
This is an optional argument which if not specified leaves the session's owner unchanged. </p></td></tr>
<p class="caption">$Session_Close function
 
</p>
<tr><th>timeout</th>
<p class="caption">%RC is set to 0 or to an error indicator.</p>
<td>The new value to be used as the session timeout value, that is the time after which the session is considered '''timed-out''', that is eligible for deletion. A value of -1 means to use the <var>[[SRSDEFTO parameter|SRSDEFTO]]</var> parameter value.  
<p class="code">  
<p>
-1 - Session not open
This is an optional argument; if it is not specified, there is no change to the session's timeout value.</p></td></tr>
0 - No errors
</table>
1 - Session id already exists for user
 
2 - Online session limit exceeded
===Status codes===
3 - User session limit exceeded
<p class="code">-1 &mdash; Session not open
</p>
&nbsp;0 &mdash; No errors
<p class="caption">$Session_Close return codes
&nbsp;1 &mdash; Session id already exists for user
&nbsp;2 &mdash; Online session limit exceeded
&nbsp;3 &mdash; User session limit exceeded
</p>
</p>
The return codes greater than 0 can only happen when one or more of the session attributes (id, owner, timeout) is being changed.


After a $SESSION_CLOSE, any session $lists, longstrings and XMLDocs will no longer be accessible.  
The status codes greater than 0 can only happen when one or more of the session attributes (<var class="term">sesid</var>, <var class="term">owner</var>, <var class="term">timeout</var>) is being changed.


If a $Session_Delete had been done for the session before it was closed by the user who had the session open or someone else, the session is immediately deleted when the $Session_Close is done. A logout always does an implied $Session_Close so $Session_Close is only necessary if another session is to be open or to minimize the time window in which the session might be requested by another thread.  
==Usage notes==
<ul>
<li>After a <var>$Session_Close</var>, any session $lists, longstrings and XMLDocs will no longer be accessible. </li>


<li>If a <var>[[$Session_Delete]]</var> had been done for the session before it was closed by the user who had the session open or someone else, the session is immediately deleted when the <var>$Session_Close</var> is done. A logout always does an implied <var>$Session_Close</var>, so <var>$Session_Close</var> is only necessary if another session is to be open or to minimize the time window in which the session might be requested by another thread.</li>
</ul>


==Example==
The following example closes the current session, making it a public session in the process:
The following example closes the current session, making it a public session in the process:
<p class="code"> %RC = $Session_Close(, '*')
<p class="code">%rc = $Session_Close(, '*')
</p>
</p>


 
==Products authorizing {{PAGENAMEE}}==
For more information about sessions
 
This $function is new in ''[[Sirius Mods]]'' Version 6.3.
<ul class="smallAndTightList">
<ul class="smallAndTightList">
<li>[[Sirius functions]]</li>
<li>[[List of $functions|Sirius functions]]</li>
<li>[[Fast/Unload User Language Interface]]</li>
<li>[[Fast/Unload User Language Interface]]</li>
<li>[[Janus Open Client]]</li>
<li>[[Media:JoclrNew.pdf|Janus Open Client]]</li>
<li>[[Janus Open Server]]</li>
<li>[[Media:JosrvrNew.pdf|Janus Open Server]]</li>
<li>[[Janus Sockets]]</li>
<li>[[Janus Sockets]]</li>
<li>[[Janus Web Server]]</li>
<li>[[Janus Web Server]]</li>
<li>[[Japanese functions]]</li>
<li>Japanese functions</li>
<li>[[Sir2000 Field Migration Facility]]</li>
<li>[[Media:SirfieldNew.pdf|Sir2000 Field Migration Facility]]</li>
 
</ul>
</ul>
<p class="caption">Products authorizing $Session_Create
</p>


[[Category:$Functions|$Session_Close]]
[[Category:$Functions|$Session_Close]]

Latest revision as of 22:11, 6 October 2015

Close an open session

Note: Many $functions have been deprecated in favor of Object Oriented methods. There is no direct OO equivalent for the $Session_Close function.

$Session_Close closes an open session, accepts three arguments and returns a zero, indicating success, or a number indicating the cause of error, if there is one.

Syntax

%rc = $Session_Close([sesid], [owner], [timeout])

Syntax terms

%rc A numeric value set to 0 or to an error indicator. See Status codes, below.
sesid A new ID to be given to the session being closed. This is an optional argument which if not specified leaves the session's ID unchanged.
owner The userid that is to be set as the new owner of the session being closed. An owner value of * means that the session is public, that is available to all users. Only a system administrator can create a non-public session for a user other than itself.

This is an optional argument which if not specified leaves the session's owner unchanged.

timeout The new value to be used as the session timeout value, that is the time after which the session is considered timed-out, that is eligible for deletion. A value of -1 means to use the SRSDEFTO parameter value.

This is an optional argument; if it is not specified, there is no change to the session's timeout value.

Status codes

-1 — Session not open  0 — No errors  1 — Session id already exists for user  2 — Online session limit exceeded  3 — User session limit exceeded

The status codes greater than 0 can only happen when one or more of the session attributes (sesid, owner, timeout) is being changed.

Usage notes

  • After a $Session_Close, any session $lists, longstrings and XMLDocs will no longer be accessible.
  • If a $Session_Delete had been done for the session before it was closed by the user who had the session open or someone else, the session is immediately deleted when the $Session_Close is done. A logout always does an implied $Session_Close, so $Session_Close is only necessary if another session is to be open or to minimize the time window in which the session might be requested by another thread.

Example

The following example closes the current session, making it a public session in the process:

%rc = $Session_Close(, '*')

Products authorizing $Session_Close