Logout not clearing session cookie when base path is set
Checklist
- [x] The issue can be reproduced in the nextjs-auth0 sample app (or N/A).
- [x] I have looked into the Readme, Examples, and FAQ and have not found a suitable solution or answer.
- [x] I have looked into the API documentation and have not found a suitable solution or answer.
- [x] I have searched the issues and have not found a suitable solution or answer.
- [x] I have searched the Auth0 Community forums and have not found a suitable solution or answer.
- [x] I agree to the terms within the Auth0 Code of Conduct.
Description
When a base path is set for the application, the default logout route is not clearing the correct session cookie. Looking at the console logs, it appears to be clearing the session cookie set at a root level (/) but not the session cookie that is set at the base path level.
Reproduction
- Follow the ReadMe to set a base path for your application.
- Login to the application and you’ll notice that the cookie is set at the correct base path specified.
- Logout of the application and you’ll notice that the session cookies are still there (the wrong ones were cleared)
Additional context
No response
nextjs-auth0 version
4.8.0
Next.js version
15.3.1
Node.js version
24.1.0
here's a potential MR which may address the problem: https://github.com/auth0/nextjs-auth0/pull/2223
Hi 👋 @mustafahasan, @mustafagft thanks for reporting and iterating on this, we'll take a look at this and release a solution soon 👍
Might this be related with #2237 ?
This was fixed with #2232 .