Session timeout - error code 3048

Hi Backendless.

For most pages I have added such logic:
image
And it was working as expected, whenever I don’t have valid session anymore, I got redirected to login page.

But for some time now, when I have switched away from my mobile browser and later that day I reopen it for my apps tab, I now don’t get redirection, but rather unfriendly message:

What could be causing this behavior change, and what would be user friendly way of handling this error code, can it be caught on the same before page enter handler?

Best Regards,
Uldis

Hello @Uldis_Borkus. Thank you for reporting to us!

But could you explain in more detail how we could reproduce this issue?
It is unclear what you mean here:

switched away from my mobile browser and later that day I reopen it for my apps tab

Are you talking about smartphones? Could you write what you do in steps?

Regards, Dima.

Hi @Dima Took some time for me to constantly reproduce issue.
For context i have following Login settings:
image
image

  1. Now, when I log into web app with a user on lets say Android smartphone (using chrome browser)
  2. Then logging in with the same user on desktop (also using chrome browser).
  3. On mobile device when i swipe to refresh, i get the above mentioned 3048 error, when i swipe to refrsh again, i the On Before Page Enter logic is executed.

This is not limited to mobile devices as the same behavior is also if switching on which device i log in first.

  1. Also note, that if I don’t refresh on the step # 3 but click to another page through navigation item, it executes On Before Page Enter logic and i am navigated to login screen as expected.
    But, additionaly there are some pages that ends up with not a redirect but with different error:

Why there is this unfriendly session expiration message? What needs to be done so that system page, session expired is displayed? Or how to handle so that end user does not see this black screen with error message?
Below is video with similar steps, just the last step is not refresh but just opening app from chrome nav bar.

I have tried to reproduce it in:

  • my app
  • your app system container with default login page
  • your app and your login

And everywhere it works as expected. Maybe you have some additional details?

Also I could advice you to repeat your steps but after each round cut off some parts of logic until everything will works fine.

Could you please share how looks the “works as expected”, as I am now getting confused as what to expect even.
Like, should it display session expired systems page, should it just redirect using my logic on before page enter, or something else is this “works as expected”?

Hello Uldis Borkus,

You are encountering these errors because the requests are being made from a logged-in user whose user token has expired. To resolve this, you should implement error handling to detect when this occurs and prompt your customer to log in again.

Regards,
Alexander

@Alexander_Pavelko

Well, I have that already implemented, please see the very first post, i have logic created for: on before page enter.

Yes, I saw your first post, but I meant trying to catch this specific error (using try-catch) and performing a redirect in that case.

Regards,
Alexander

Got it, I do have try-catch within the logic as well, but i don’t execute redirect there.
Thank you for idea.

1 Like