Join Discord
Powered by
(emailpassword & session - react - python-flask) s...
# support-questions-legacy
j
jaygokhale
09/25/2022, 3:14 AM
(emailpassword & session - react - python-flask) set and clear custom cookies on signin and signout
jaygokhale
09/25/2022, 3:14 AM
I'd like to set / clear custom cookies on signin and signout. The recommended approach to build a signin backend callback in python, doesn't appear to give access to a mutable response object.
https://supertokens.com/docs/emailpassword/common-customizations/handling-signin-success#2-on-the-backend
. Is there an approach I'm overlooking or a workaround for this?
r
rp_st
09/25/2022, 4:15 AM
Hey! You could write your own middleware and detect when these paths are called. And then mutate the response object however you’d like to
j
jaygokhale
09/26/2022, 7:08 AM
thanks! I was able to use flask's
after_request
hook to accomplish this. I matched on
request.path
r
rp_st
09/26/2022, 7:11 AM
nice!
2
Views
Previous
Next