# Cannot update session

**URL:** <https://community.auth0.com/t/cannot-update-session/140248>\
**Category:** Get Help\
**Tags:** authentication-sessions, sessions\
**Created:** [August 1, 2024, 12:03pm UTC](https://community.auth0.com/t/cannot-update-session/140248 "2024-08-01T12:03:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rio.h](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@rio.h](https://community.auth0.com/u/rio.h)\
**Post date:** [August 1, 2024, 12:03pm UTC](https://community.auth0.com/t/cannot-update-session/140248/1 "2024-08-01T12:03:12Z")

</div>

Hello, please help me with the problem.

On project we use Auth0 and Next.js. Thus, also @auth0/nextjs-auth0 is used. User creates account with Auth0, then after passing the onboarding a newcomer gets a new role. However the role is unavailable on the frontend and as a result our backend doesn’t accept requests and returns 403 error. It is because the token got when user signed in is still used.

The session object I got with getSession stays unchanged, the role there is empty. Everything works well only if user logs out and logs in again and, as a result, the session object also updates and the user gets a role. Only then all processes continue to work as they were predicted.

What should be done? I sent request to get a new token and added it to session object but no result was brought. What should be done to update session? Or maybe problem even is not in session?

---

<div class="post-metadata">

**Author:** ![wyatt](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/wyatt/32/60248_2.png) [@wyatt](https://community.auth0.com/u/wyatt)\
**Post date:** [September 10, 2024, 3:23pm UTC](https://community.auth0.com/t/cannot-update-session/140248/2 "2024-09-10T15:23:10Z")

</div>

@rio.h we use the updateSession method in our project. Here’s their documentation:

> **[updateSession | @auth0/nextjs-auth0](https://auth0.github.io/nextjs-auth0/functions/index.updateSession-1.html)**
>
> Documentation for @auth0/nextjs-auth0

I’m troubleshooting some issues with that at the moment, which is why I came across your question.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [February 28, 2025, 6:11pm UTC](https://community.auth0.com/t/cannot-update-session/140248/3 "2025-02-28T18:11:50Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
