$Session Delete: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
Line 6: Line 6:
<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]], 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 the id of the session to be deleted. This is a required argument.


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.
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.
==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" />%rc = $Session_Delete(sesid, owner, timeout)
<p class="syntax"><section begin="syntax" />%rc = $Session_Delete(sesid, [owner], [timeout])
<section end="syntax" /></p>
<section end="syntax" /></p>


<p>%rc is set to 0 or to an error indicator:</p>
===Syntax terms===
<table class="syntaxTable">
<tr><th>%rc</th>
<td>Set to 0 or to an error indicator:
<p class="code">0 - No errors
<p class="code">0 - No errors
1 - Session not found
1 - Session not found
2 - Session in use
2 - Session in use
</p>
</p></td></tr>
 
<tr><th>sesid</th>
<td>The id of the session to be deleted. This is a required argument. </td></tr>
 
<tr><th>owner</th>
<td>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. </td></tr>
 
<tr><th>timeout</th>
<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. This argument defaults to 0 which means that if the session is in-use it is deleted asynchronously.</td></tr>
</table>


==Usage notes==
==Usage notes==

Revision as of 20:23, 29 October 2012

Delete a session

Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $Session_Delete function is to be entered.

$Session_Delete deletes a session, accepts three arguments and returns a zero, indicating success, or a number indicating the cause of error, if there is one.


Syntax

<section begin="syntax" />%rc = $Session_Delete(sesid, [owner], [timeout]) <section end="syntax" />

Syntax terms

%rc Set to 0 or to an 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 of "*" 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 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:

%SESID = $Session_Id %RC = $Session_Delete(%SESID) %RC = $Session_Close


Products authorizing $Session_Delete