DenoDDeno
Powered by
zingZ
Denoβ€’3y agoβ€’
6 replies
zing

Fresh pattern help

Could anyone possibly help guide me to understand the 'freshest' pattern for the following, please?

When a user hits
/
/
I load a login page, and once he submits the form, the server generates some session data in the POST handler for
/
/
, and then redirects(send back a 303) to
/chat
/chat
. There is an island on
/chat
/chat
which needs to contain the session data. How would I redirect from the form POST handler, to the
/chat
/chat
page and make sure that my state is passed to the island?

In react or similar I would handle the 'form submission' in javascript and cache the returned session data before redirecting to
/chat
/chat
. Since fresh seems to promote the use of native forms I'm trying to learn how I would handle this situation. I'm thinking of setting a cookie in the redirect, to then be sent with the
/chat
/chat
GET, which I can use to return the page with session data inside. Is that common? Thanks!
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

fresh-runtime
nandi.weird.oneNnandi.weird.one / help
16mo ago
fresh + workspace
devinDdevin / help
16mo ago
Deno fresh
TheYuriGTTheYuriG / help
3y ago