pallets-eco / flask-session

Server side session extension for Flask
https://flask-session.readthedocs.io
BSD 3-Clause "New" or "Revised" License
501 stars 239 forks source link

Session fails because of no secret_key #66

Closed Cereal2nd closed 7 months ago

Cereal2nd commented 7 years ago

When no secret key is set the get_signer returns None but this is not catched.

2017-02-16 19:17:08,522 domogik.admin.application ERROR Request finalizing failed with an error while handling an error Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1632, in finalize_request response = self.process_response(response) File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1858, in process_response self.save_session(ctx.session, response) File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 924, in save_session return self.session_interface.save_session(self, session, response) File "/usr/local/lib/python2.7/dist-packages/Flask_Session-0.3.0-py2.7.egg/flask_session/sessions.py", line 357, in save_session session_id = self._get_signer(app).sign(want_bytes(session.sid)) AttributeError: 'NoneType' object has no attribute 'sign'

fengsp commented 7 years ago

As far as I can see, the session would be one null session and won't be saved, what is your Flask version?

Lxstr commented 7 months ago

Null session causing misleading error. Will be fixed from 0.7.0