Add cookie type safety into Remix #5100
mikeybinns
started this conversation in
Proposals
Replies: 1 comment 2 replies
-
The main problem here is that the user may tamper the cookie on the browser which means what you told to the createCookie object your cookie must contain may not be true. I think type-safety in cookies (and sessions) should be achieved by runtime checks rather than statically since there's no way to really trust what comes from the browser, remember you should never trust user input, and cookies are user input. In Remix Utils I was able to combine |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I actually created a PR for this a while back, it's been approved by @MichaelDeBoey since June 22, but never got merged in, so I'm making this post so hopefully it gets noticed in a Roadmap planning session.
Relates to: #3224
Adding type safety for cookies will allow users to specify what object to expect from a cookie, and allow for more type safe interactions with cookies without needing to do something like the following:
Beta Was this translation helpful? Give feedback.
All reactions