# How can I refresh the cache after a user changes their username?

**URL:** <https://forum.heroiclabs.com/t/how-can-i-refresh-the-cache-after-a-user-changes-their-username/1745>\
**Category:** Game Design\
**Tags:** authentication, sdk-unity, users\
**Created:** [June 28, 2021, 8:33am UTC](https://forum.heroiclabs.com/t/how-can-i-refresh-the-cache-after-a-user-changes-their-username/1745 "2021-06-28T08:33:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nixarn](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/nixarn/32/391_2.png) [@nixarn](https://forum.heroiclabs.com/u/nixarn)\
**Post date:** [June 28, 2021, 8:33am UTC](https://forum.heroiclabs.com/t/how-can-i-refresh-the-cache-after-a-user-changes-their-username/1745/1 "2021-06-28T08:33:40Z")

</div>

Because Nakama caches the username and doesn’t update the cache when you change it (is this a bug?) I wanted to call **SessionRefreshAsync()** to fix the cache, but when I do this call, I keep getting an API Response Exception: “Refresh Token is required”. What could I be doing wrong?

Also, as this function isn’t documented yet (?) should your store this refreshed token after the call, I guess you need to do that as JWT includes the expire time?

Thanks!

---

<div class="post-metadata">

**Author:** ![lugehorsam](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/lugehorsam/32/314_2.png) [@lugehorsam](https://forum.heroiclabs.com/u/lugehorsam)\
**Post date:** [July 7, 2021, 7:22pm UTC](https://forum.heroiclabs.com/t/how-can-i-refresh-the-cache-after-a-user-changes-their-username/1745/2 "2021-07-07T19:22:37Z")

</div>

Hey @nixarn 👋 could you share how you’re calling `SessionRefreshAsync`?

Nakama doesn’t manage your cache for you because there are lots of different ways of caching your data. So yeah you’ll need to store the refresh token and pass it to `SessionRefreshAsync` when you are obtaining a new auth token.
