Getting same access token after logout and login again in iOS?



I am using this to logout from Twitter -

    TWTRSessionStore *store = [[Twitter sharedInstance] sessionStore];
    NSString *userID = store.session.userID;
    [store logOutUserID:userID];

But while login again I am getting the same access token and secret. The thing is from our server side we came to know that user token is expired so we made user to login again but we are getting same access token every time. How to get a new access token? - I am using my own button with a handler.

And I am using this to login.

  • (void)logInWithCompletion:(TWTRLogInCompletion)completion;


Thanks for posting this @kidsid49, do you have any other code around handling the session that isn’t posted?


@bonnell No that’s it.
I use Fabric TwitterKit just for login and logout.


Thanks @kidsid49, digging deeper into this - how are you detecting that the token has expired on your servers? If the token’s not expired, I could see this behavior happening, but not on an expired token.


@bonnell here our backend developer posted this issue.


Thanks, I’ll take a look at that one and close this thread.