I am using SalesforceSDK for Android in one of my apps. The issue I am facing is, I am not able to re-login as a different user after logging out. The code I am using for logout the current user is


After that the login screen comes. But while I try to login as a different user, it throws the below error and goes back to login screen again.

{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}

If I re-login as same user, I am not getting this error. To successfully re-login as a new user, I have to kill the app from background and then relaunch it.

Kindly help me on this. Thank you in advance.

  • Are you using a single instance of the SalesforceSDKManager? Can you create a new one after performing the logout? – Daniel Ballinger Jul 30 '17 at 21:17
  • @DanielBallinger Thank you for the response, Daniel. But I didn't see an option to create a separate instance of SDKManager. If you have done this earlier, could you please add some code snippet which I can use? – Jayakrishnan Salim Jul 31 '17 at 5:30
  • I'd suggest raising it as an issue in Github - SalesforceMobileSDK-Android – Daniel Ballinger Aug 1 '17 at 0:29
  • Okay. I saw an updated library of SalesforceSDK in GitHub. In the sample app in that repo, the logout functionality is working fine. I am now trying to integrate it. – Jayakrishnan Salim Aug 1 '17 at 4:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.