Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

RedirectResponse, HtmlResponse #21

Open
disugiske opened this issue Aug 8, 2022 · 0 comments
Open

RedirectResponse, HtmlResponse #21

disugiske opened this issue Aug 8, 2022 · 0 comments

Comments

@disugiske
Copy link

disugiske commented Aug 8, 2022

Don't work with RedirectResponse, HtmlResponse, because you can't add cookie to response (example: response.set_cookie(key="fakesession", value="fake-cookie-session-value")). Solution: set cookie.attach_to_response(response, session) after response.
Example:

response = templates.TemplateResponse("auth.html", {"request": request })
cookie.attach_to_response(response, session)
return response

Please add this info to instuction, i spent a few hours to figure it out.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant