something broke in session expiration

I’m using this code for getting user session info (I think it’s recommended by dev team):

var cache = Backendless.LocalCache.getAll();
if (cache["stayLoggedIn"]) {
    if (Backendless.UserService.isValidLogin()) {
        loggedInUser = Backendless.UserService.getCurrentUser();
    } else {
        console.log("token expired! relogin!");
} else {
    console.log("not logged!");

it’s worked OK up until recently, but starting a few days ago (maybe even week or two) the behavior changed, now when token is expired (I think it’s expired), code Backendless.UserService.isValidLogin() still executes to true, but next api call Backendless.UserService.getCurrentUser() gives exception “Uncaught [object Object]” which, if debugged, is actually {“code”:3048,“message”:“Session timeout. Url: <>”,“statusCode”:302}

Hello Yuriy

We’ve reproduce the issue with existing but expired user-token. Backendless.UserService.isValidLogin() returned ‘false’ . So further code execution would fail.

Could you please provide the step sequence of how you cought this issue?

Regards Anton

Well, funny thing is that now it’s working as intended - Backendless.UserService.isValidLogin() gives false for expired token. But I saw it for several days in several browsers, so I’m pretty much sure that it’s not careless mistake from my side. Ok then, solved for now

I’m experiencing same type of error again now.
Backendless.UserService.isValidLogin() gives true, but after that Backendless.UserService.getCurrentUser() raise exception
Uncaught Object {code: 3048, message: "Session timeout. Url: <…-586EEF9BD600/page/session_expiration/index.html>";, statusCode: 302}

my settings for user login:
enable multiple logins (16)
enable session timeout (304800 sec)
unlimited unsucseful logins

Hi Yuriy,

It could be temporal issue. If you reproduce this issue once more, don’t feel hesitate to contact us.



I did, in this very topic, couple of days ago and after waiting some time opened started another topic