invalidateAllSessions( ) stand-alone function
- Last Updated: March 30, 2020
- 2 minute read
- OpenEdge
- Version 12.2
- Documentation
A stand-alone function that invalidates all
current progress.data.JSDOSession instances that were
created and initialized using the progress.data.getSession( ) stand-alone function.
This function combines the features of:
- Finding all existing
JSDOSessioninstances created using thegetSession( )stand-alone function. - Calling the
invalidate( )method on each instance, which in turn calls thelogout( )method on the instance.
After invalidateAllSessions( ) executes,
any call made to the addCatalog( ), isAuthorized( ), login( ), or
ping( ) method on an existing JSDOSession instance, or any attempt to instantiate a progress.data.JSDO, throws an exception. In addition, calls to any method on an
existing JSDO instance that communicates with the server
associated with an invalidated JSDOSession throws an
exception as well.
This method is always executed asynchronously and returns results in callbacks that you register using methods of a Promise object returned as the function value.
Return type: jQuery Promise
Applies to: The progress.data namespace
Syntax
|
Promise method signatures
jQuery Promise objects define methods that register a callback function
with a specific signature. The callback signatures depend on the function that returns the
Promise. Following are the signatures of callbacks registered by methods in any Promise
object that invalidateAllSessions( ) returns:
Syntax:
|
always( ) method is always passed what the done( )
or the fail( ) methods are passed.- promise
- A reference to the Promise object that is returned as the value of
the
invalidateAllSessions( )function. For more information on Promises, see the notes on Promises in the description of the progress.data.JSDOSession class. - result
- An
integerconstant indicating the overall result of the call that can have one of the following values:-
progress.data.Session.SUCCESS— Invalidate of allJSDOSessioninstances has completed successfully. -
progress.data.Session.GENERAL_FAILURE— The invalidate failed because of some error.
Note: It is not always necessary to test the value of result in a Promise method callback forinvalidateAllSessions( ), especially if the callback is registered usingpromise.done( ), where the callback always executes with the same value (progress.data.Session.SUCCESS). -
- info
- A JavaScript object that can have the following properties:
errorObject— An error object thrown while attempting to terminate anyJSDOSessioninstance.xhr— A reference to the XMLHttpRequest object sent to the web server for theJSDOSessionobject that threw the error object.
Example
The following code fragment calls the invalidateAllSessions( ) method to terminate and invalidate the login session
for every current JSDOSession instance that is created
using progress.data.getSession( ). This example uses
try and catch blocks
in case invalidateAllSessions( ) throws an unexpected
exception, and displays messages returned from Promise handlers accordingly:
|
Note that this example creates only a single login session. Any additional login sessions
can be created, and associated JSDO tasks performed, anywhere appropriate in the same
Promise chain prior to the Promise always( ) method
handler where invalidateAllSessions( ) is invoked.
See also:
invalidate( ) method, logout( ) method (JSDOSession class), getSession( ) stand-alone function, progress.data.JSDOSession class