Logout user Android SDK

Hi.

In Android SDK, after using stayLoggedIn to avoid the login screen after a user has logged in, i am getting this message when trying to log out (using Backendless.UserService.logout):

3023 - Unable to logout user due to error: user must be logged in.

User has not logged in again because the token was stored in UserTokenStorageFactory, precisely to avoid showing the login screen. What should be the right way to handle the logout in this case and clear the stored data (Backendless.UserService.loggedInUser() still returns userId after error)?

Regards,
Andrés

Hi Kate.

I don´t understand. To log in the user again, i need to have his/her password. The idea of using stayLoggedIn is to avoid the login process and storing password in device. What is the point of using stayLoggedIn if have to log in user again anyway?

Regards,
Andrés

Andres,

we will check this issue and notify you about changes.

Question: you set session expiration for user login?
(backendless console -> Users -> Login tab)

Thanks Kate.

Session expiration (Enable Session Timeout) is currently disabled in my app. If I enable it, could you please tell me the expected behaviour when using stayLoggedIn = true in login?

Regards,
Andrés

Hi Kate.

Do you have any update on this?

Regards,
Andrés

Hi!

Currently we are working on new logic, which will help you to validate user token
and check session expiration in better way.
New api changes will coming soon.

We will notify you and describe changes.

Regards,
Kate.

Hi, Andres.

You can login user again.

Or you can get code sample from code generation
(Code Generation tab -> Android -> Registration and Login)