What's the best way of checking if the user still is logged in? JSDOSession.connected seens not to be working for me.
What I'm doing to test this:
1) Login my application (with JSDOSession)
2) I acess my service logout page (OERealm Form auth at localhost:8810/<SERVICE>/static/auth/logout.jsp) and logout (to simulate an expired session)
3) Inside my application, i check for JSDOSession.connected, and it return's true (since I didn't used the logout method of my jsdoSession)
Any suggestions?
Hi Matheus,
Try calling JSDOSession.ping() and checking the 2nd argument of the promise callback (the "result" parameter in the Progress documentation), which should be false. For additional information (to determine whether it's an authentication problem or some other reason for being offline), check the 3rd argument -- it's an argument that has an "offlineReason" property which may be set to progress.data.Session.AUTHENTICATION_FAILURE (numeric value 2), and an "xhr" property that gives you access to the XMLHttpRequest object that was used call ping().
Calling ping() will set the connected property to false if it fails, by the way.
--Wayne
Hi Matheus,
Try calling JSDOSession.ping() and checking the 2nd argument of the promise callback (the "result" parameter in the Progress documentation), which should be false. For additional information (to determine whether it's an authentication problem or some other reason for being offline), check the 3rd argument -- it's an argument that has an "offlineReason" property which may be set to progress.data.Session.AUTHENTICATION_FAILURE (numeric value 2), and an "xhr" property that gives you access to the XMLHttpRequest object that was used call ping().
Calling ping() will set the connected property to false if it fails, by the way.
--Wayne