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
Right now, cookies set during a single flight request are available on the redirected route, but it doesn't account for setting cookies to an empty string or the max age or expires fields.
Expected behavior 🤔
You should be able to set a cookie to the empty string, as well as fully remove a cookie by setting an appropriate max-age or expires.
It will redirect to home page and then back immediately.
Context 🔦
I'm trying to redirect users based on their logged in status. The homepage should redirect logged in users to the protected page, and the protected page should directed unauthenticated users to the homepage.
The logout action calls setCookie(), but since cookies are not deleted, it breaks the logout logic. This is due to the current implementation of createSingleFlightHeaders
Duplicates
Latest version
Current behavior 😯
Right now, cookies set during a single flight request are available on the redirected route, but it doesn't account for setting cookies to an empty string or the max age or expires fields.
Expected behavior 🤔
You should be able to set a cookie to the empty string, as well as fully remove a cookie by setting an appropriate max-age or expires.
Steps to reproduce 🕹
Reproduction
https://codesandbox.io/p/devbox/wonderful-sunset-dq8cjl
The cookies and redirects are weird in codesandbox so here is a separate repo
Repo
https://github.com/zhengkyl/delete-cookie
Steps:
Context 🔦
I'm trying to redirect users based on their logged in status. The homepage should redirect logged in users to the protected page, and the protected page should directed unauthenticated users to the homepage.
The logout action calls
setCookie()
, but since cookies are not deleted, it breaks the logout logic. This is due to the current implementation of createSingleFlightHeaderssolid-start/packages/start/src/runtime/server-handler.ts
Lines 309 to 335 in 28e3fc5
Your environment 🌎
The text was updated successfully, but these errors were encountered: