$Session Delete: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (misc cleanup)
 
(29 intermediate revisions by 4 users not shown)
Line 2: Line 2:
<span class="pageSubtitle">Delete a session</span>
<span class="pageSubtitle">Delete a session</span>


<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $Session_Delete function is '''[[to be entered]]'''.</p>
<p class="warn"><b>Note: </b>Many $functions have been deprecated in favor of Object Oriented methods. The O-O equivalent of $Session_Delete is the <var>[[Global_and_session_objects#Using_system_class_methods_to_access_global_and_session_objects|DiscardSession]]</var> shared method.</p>


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


The first argument is the id of the session to be deleted. This is a required argument.  
==Syntax==
<p class="syntax"><span class="term">%rc</span> = <span class="literal">$Session_Delete</span>(<span class="term">sesid</span>, <span class="squareb">[</span><span class="term">owner</span><span class="squareb">]</span>, <span class="squareb">[</span><span class="term">timeout</span><span class="squareb">]</span>)
</p>
 
===Syntax terms===
<table>
<tr><th>%rc</th>
<td>A numeric variable that is set to 0, indicating success, or to a numeric error indicator:
<p class="code">0 - No errors
1 - Session not found
2 - Session in use
</p></td></tr>
 
<tr><th>sesid</th>
<td>The ID of the session to be deleted. This is a required argument. </td></tr>


The second argument is the userid that owns the session to be deleted. An '''owner''' of "*" means that the session is public, that is available to all users. This optional argument defaults to the creating user's userid.  
<tr><th>owner</th>
<td>The userid that owns the session to be deleted. An <var class="term">owner</var> value of asterisk (<tt>*</tt>) means that the session is public, that is available to all users.  
<p>
This optional argument defaults to the creating user's userid. </p></td></tr>


The third argument is the time to wait for an in-use session to be closed to perform a synchronous delete. If timeout is 0 or the session being deleted is the session currently opened by the invoking user or the session is not closed within the indicated timeout time, the session is deleted asynchronously when the session is closed. This argument defaults to 0 which means that if the session is in-use it is deleted asynchronously.
<tr><th>timeout</th>
==Syntax==
<td>The time to wait for an in-use session to be closed to perform a synchronous delete. If timeout is 0, or the session being deleted is the session currently opened by the invoking user, or the session is not closed within the indicated timeout time, the session is deleted asynchronously when the session is closed.  
<p class="syntax"><section begin="syntax" />%rc = $Session_Delete(sesid, owner, timeout)
<p>
<section end="syntax" /></p>
This argument defaults to 0, which means that if the session is in-use, it is deleted asynchronously.</p></td></tr>
<p class="caption">$Session_Delete function
</table>
</p>
<p>%RC is set to 0 or to an error indicator.</p>
<p class="code">  
0 - No errors
1 - Session not found
2 - Session in use
</p>
<p class="caption">$Session_Delete return codes
</p>


==Usage notes==
<ul>
<li>A return code of 2 indicates that while the session has not been deleted, it will be as soon as it is closed. In fact, this would be the normal return code when deleting the current session &mdash; the session actually being deleted when it is closed or the user logs off.
</ul>


A return code of 2 indicates that while the session hasn't been deleted, it will be as soon as it is closed. In fact, this would be the normal return code when deleting the current sesssion — the session actually being deleted when it is closed or the user logs off.
==Example==
The following example deletes the current session no matter what its id:
The following example deletes the current session no matter what its ID:
<p class="code"> %SESID = $Session_Id
<p class="code">%sesid = $Session_Id
%RC = $Session_Delete(%SESID)
%rc = $Session_Delete(%sesid)
%RC = $Session_Close
%rc = [[$Session_Close]]
</p>
</p>


<h2>Products authorizing {{PAGENAMEE}}</h2><ul class="smallAndTightList">
==Products authorizing {{PAGENAMEE}}==
<li>[[Sirius functions]]</li>
<ul class="smallAndTightList">
<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>
</p>


[[Category:$Functions|$Session_Delete]]
[[Category:$Functions|$Session_Delete]]

Latest revision as of 22:24, 6 October 2015

Delete a session

Note: Many $functions have been deprecated in favor of Object Oriented methods. The O-O equivalent of $Session_Delete is the DiscardSession shared method.

$Session_Delete deletes a session.

Syntax

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

Syntax terms

%rc A numeric variable that is set to 0, indicating success, or to a numeric error indicator:

0 - No errors 1 - Session not found 2 - Session in use

sesid The ID of the session to be deleted. This is a required argument.
owner The userid that owns the session to be deleted. An owner value of asterisk (*) means that the session is public, that is available to all users.

This optional argument defaults to the creating user's userid.

timeout The time to wait for an in-use session to be closed to perform a synchronous delete. If timeout is 0, or the session being deleted is the session currently opened by the invoking user, or the session is not closed within the indicated timeout time, the session is deleted asynchronously when the session is closed.

This argument defaults to 0, which means that if the session is in-use, it is deleted asynchronously.

Usage notes

  • A return code of 2 indicates that while the session has not been deleted, it will be as soon as it is closed. In fact, this would be the normal return code when deleting the current session — the session actually being deleted when it is closed or the user logs off.

Example

The following example deletes the current session no matter what its ID:

%sesid = $Session_Id %rc = $Session_Delete(%sesid) %rc = $Session_Close

Products authorizing $Session_Delete