# How do we ensure a session is still valid on refresh with NextJS app folder?

**URL:** <https://community.auth0.com/t/how-do-we-ensure-a-session-is-still-valid-on-refresh-with-nextjs-app-folder/113616>\
**Category:** Get Help\
**Tags:** sessions, logout\
**Created:** [August 14, 2023, 9:40pm UTC](https://community.auth0.com/t/how-do-we-ensure-a-session-is-still-valid-on-refresh-with-nextjs-app-folder/113616 "2023-08-14T21:40:52Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [February 18, 2025, 7:56pm UTC](https://community.auth0.com/t/how-do-we-ensure-a-session-is-still-valid-on-refresh-with-nextjs-app-folder/113616/6 "2025-02-18T19:56:06Z")

</div>

Hi everyone and @bradleygriffith-cit

Thank you for posting your questions on the community!

I am sorry about the late reply to your post.

For the issue you are experiencing, I would advise to check the session of the user whenever they access the webpage and redirect them to the `logout` endpoint since your application does not seem to handle that.

I would recommend to review this [community post](https://community.auth0.com/t/getsession-unable-to-authenticate-user-in-nextjs-server-side/121394), also [How to redirect user to login when token is expire](https://community.auth0.com/t/how-to-redirect-user-to-login-when-token-is-expire/119959) and this [knowledge article](https://community.auth0.com/t/sync-session-with-auth0-when-using-next-js/114256) regarding the matter.

If you have found a solution or have additional questions regarding the matter, feel free to leave a reply or post again on the community!

Kind Regards,  
Nik

---

_[View the full topic](https://community.auth0.com/t/how-do-we-ensure-a-session-is-still-valid-on-refresh-with-nextjs-app-folder/113616)._
