Can't set auth session (cookie) when using hypercorn worker
I noticed by using quart_auth for login it works like charm when i start my quart server by calling the quart app.run inside my app.py (start via python app.py
)
But when i then call hypercorn from the terminal to start the app.py, the quart server is not able to set the cookie data from the login. I got no warn or a error message in the logs (tested different log levels: DEBUG & NOTSET)
My hypercorn call:
hypercorn --workers 2 --log-level NOTSET --access-logfile - --error-logfile - --bind 0.0.0.0:3333 --keep-alive 300 src.app:app
I used the example from this repo to have one route which required a login via decorator and built a login page to check and validate the user before i call login_user(AuthUser(user))
.
Until this point alle looks fine, but on hypercorn approach i receive an Unauthorized exception and got redirected to my login page, as this is my default app.errorhandler for Unauthorized exceptions.
Did one of you ever notices such an behaviour in combination with hypercorn?
The curious thing is as soon as i switch back to calling the quart app.run via python app.py
the cookie from the login is created. When i then switch to start the app via hypercorn again, the app is able to load the cookie from the set cookie data.
I am using Python 3.7.7