Fix bug in Python 3 using Session Management middleware.

This commit is contained in:
Ignacio Fiorentino 2016-11-04 15:40:35 -03:00
parent 2ec9cbe334
commit 8a4103edca

View file

@ -12,6 +12,6 @@ class SessionManagementMiddleware(MiddlewareMixin):
"""
def process_response(self, request, response):
session_state = sha224(request.session.session_key or django_settings.SECRET_KEY).hexdigest()
session_state = sha224((request.session.session_key or django_settings.SECRET_KEY).encode('utf-8')).hexdigest()
response.set_cookie('op_browser_state', session_state)
return response