# Session-Key doesn't match user\_id (Flutter, Chat)

**URL:** <https://community.sendbird.com/t/session-key-doesnt-match-user-id-flutter-chat/3330>\
**Category:** Flutter\
**Tags:** chatsdk\
**Created:** [November 5, 2021, 2:36am UTC](https://community.sendbird.com/t/session-key-doesnt-match-user-id-flutter-chat/3330 "2021-11-05T02:36:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![SungYong\_Ko](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/sungyong_ko/32/1671_2.png) [@SungYong\_Ko](https://community.sendbird.com/u/SungYong_Ko)\
**Post date:** [November 5, 2021, 2:36am UTC](https://community.sendbird.com/t/session-key-doesnt-match-user-id-flutter-chat/3330/1 "2021-11-05T02:36:06Z")

</div>

Hi!

We are intermittently facing an issue when users connect to sendbird server.  
Afterwards, trying to load the list of available channels we get the following message Not authorized. "Session-Key doesn’t match user\_id

Any idea why can this happen?

What is the expiration time of the session key managed by SDK?  
Also, is there a way I can refresh this session key?

Thank you.

---

<div class="post-metadata">

**Author:** ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)\
**Post date:** [November 5, 2021, 1:13pm UTC](https://community.sendbird.com/t/session-key-doesnt-match-user-id-flutter-chat/3330/2 "2021-11-05T13:13:10Z")

</div>

Hi @SungYong_Ko,

You shouldn’t be running into this type of issue with normal usage. Is it happening to a specific user or many users? Additionally, how long after the user connects does this appear to happen?

---

<div class="post-metadata">

**Author:** ![SungYong\_Ko](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/sungyong_ko/32/1671_2.png) [@SungYong\_Ko](https://community.sendbird.com/u/SungYong_Ko)\
**Post date:** [November 7, 2021, 1:08pm UTC](https://community.sendbird.com/t/session-key-doesnt-match-user-id-flutter-chat/3330/3 "2021-11-07T13:08:31Z")

</div>

Now we have a few active user. It is happening to two user.  
Looking at the log, one user had an issue 17 hours after the app was booted.

We call “sendbird.connect(userId)” when app boots. We call “sendbird.disconnect” only when the user logs out. Is that wrong?

---

<div class="post-metadata">

**Author:** ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)\
**Post date:** [November 8, 2021, 7:46pm UTC](https://community.sendbird.com/t/session-key-doesnt-match-user-id-flutter-chat/3330/4 "2021-11-08T19:46:33Z")

</div>

Hi @SungYong_Ko, what you’ve described doesn’t sound wrong by any means. You should be calling `disconnect()` when the user no longer needs to be connected to Sendbird. Just to confirm, the user logged into the app, was actively connected for 17 hours, and then received the error?

---

<div class="post-metadata">

**Author:** ![SungYong\_Ko](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/sungyong_ko/32/1671_2.png) [@SungYong\_Ko](https://community.sendbird.com/u/SungYong_Ko)\
**Post date:** [November 9, 2021, 1:35am UTC](https://community.sendbird.com/t/session-key-doesnt-match-user-id-flutter-chat/3330/5 "2021-11-09T01:35:26Z")

</div>

Hi @Tyler  
I’m sorry. I gave you the wrong information.  
Currently, we don’t know the exact information about how long it has been since the user connected.  
Instead, I can give the user’s ID and time information of the problem. (This is my ID.)  
I DM you.
