Mattermost, Inc.

Invalid or expired session, please login again

I am using mattermost rest api. Endpoints that does not need autorization header works fine. But other endpoints are returning 401 invalid or expired session. The session doesnot expired by the way. It was working fine and now not working . It is a bit strange. I am stuck here any help?

Hi @tsadkan, it sounds like the token used for the authentication of the API call has expired. Could you tell us when the token was created, and how it was created? What kind of token is it?

Hi @joewai.tye, Sorry it is my bad. I found out that the rest client I was using stores the request header in a cache and not updating on the next request. So, first I tried with wrong token and when I tried it with the correct token it recalls the previous one resulting in invalid or expired session. Thank you anyways.