How to handle cookies? #2473
Unanswered
nbigaouette
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all! I have written a simple backend (in axum) and now trying to write a frontend for it. There's a simple API but it requires a cookie to be set to identify clients. From what I understand the webassembly-compiled dioxus app does not have access to the browser cookie; backend queries happen through an http client (ie reqwest) which is independent of the browser.
That means that the app needs to perform its own reqwest requests and handle the cookie itself. Can I share a reqwest::Client across the app (so that cookies are kept and reused)? I don't know if this is possible, when I tried rustc complained that reqwest's
ClientBuilder
didn't have thecookie_store()
method, even though I enabled thecookies
cargo feature.In any case, what is the proper way to make backend requests and saving/providing cookies?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions