You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The headers set in the backend should be reflected in the browser. The backend sets cookies (myRefreshToken and accessToken) during the sign-in process.
However, in the browser's "Application" tab, only the accessToken cookie is visible.
Additional Information
The withCredentials: true option is set in the Axios request.
The backend's CORS configuration allows credentials.
The SameSite attribute for the myRefreshToken cookie is set to lax.
Observation:
The response headers returned by the backend during the sign-in process contain the myRefreshToken cookies, as confirmed by logging console.log('Response headers:', response.headers);. While the headers appear correct in the network response and logs, the myRefreshToken cookie is not being set in the browser, even though it is present in the Set-Cookie header of the response.
The text was updated successfully, but these errors were encountered:
Reproduction
You can access the backend code: https://github.com/sidyr6002/chat-app-backend,
frontend code: https://github.com/sidyr6002/chat-app-frontend
Frontend Setup
.env
file with the following content:Backend Setup
cd /database docker compose up
.env
file with the following content:System Info
Used Package Manager
pnpm
Expected Behavior
The headers set in the backend should be reflected in the browser. The backend sets cookies (
myRefreshToken
andaccessToken
) during the sign-in process.Backend Code (NestJS):
Frontend Code (React Router Action):
The
signin
API sets themyRefreshToken
cookie in the backend and sends theaccessToken
to the frontend. Both cookies should appear in the browser.Actual Behavior
Only one cookie (
accessToken
) is being set in the browser. ThemyRefreshToken
cookie, which is set by the backend, does not appear in the browser.Upon inspecting the network request in the browser's developer tools, the response headers from the backend include both cookies:
However, in the browser's "Application" tab, only the
accessToken
cookie is visible.Additional Information
withCredentials: true
option is set in the Axios request.SameSite
attribute for themyRefreshToken
cookie is set tolax
.Observation:
The response headers returned by the backend during the sign-in process contain the myRefreshToken cookies, as confirmed by logging console.log('Response headers:', response.headers);. While the headers appear correct in the network response and logs, the myRefreshToken cookie is not being set in the browser, even though it is present in the Set-Cookie header of the response.
The text was updated successfully, but these errors were encountered: