Creating a custom page using many javascript
when the session is expired or logout the javascript is still alive untill the page load.
How can I check the session is expired or session is logout
in the javascript
if (session logout) {
window.location.href = '/login';
}
Session is server side, you cannot check by JavaScript. That’s why PHPMaker uses a timer based on your advanced settings, see Session timeout period (minutes).
There is no ew.fetchJson(). Did you mean ew.fetch()? Anyway, there is no direct way to check “session is logout” by JavaScript. However, if the user is not logged in, there is no current user info passed to the client side, e.g. ew.CURRENT_USER_NAME == ''.
As explained your other topic, if you logs out in other browser, it will not affect your current status in another browser on the client side, until you refresh the page or go to another page.