diff --git a/django/contrib/sessions/backends/db.py b/django/contrib/sessions/backends/db.py index 0d68f13e68..85c4a0dd3c 100644 --- a/django/contrib/sessions/backends/db.py +++ b/django/contrib/sessions/backends/db.py @@ -3,6 +3,7 @@ from django.contrib.sessions.models import Session from django.contrib.sessions.backends.base import SessionBase, CreateError from django.core.exceptions import SuspiciousOperation from django.db import IntegrityError, transaction +from django.utils.encoding import force_unicode class SessionStore(SessionBase): """ @@ -14,7 +15,7 @@ class SessionStore(SessionBase): session_key = self.session_key, expire_date__gt=datetime.datetime.now() ) - return self.decode(s.session_data) + return self.decode(force_unicode(s.session_data)) except (Session.DoesNotExist, SuspiciousOperation): self.create() return {}