diff --git a/src/authentic2/middleware.py b/src/authentic2/middleware.py index 237146fc5..4fd00103d 100644 --- a/src/authentic2/middleware.py +++ b/src/authentic2/middleware.py @@ -14,19 +14,15 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -import random -import struct import time try: import threading except ImportError: threading = None -from binascii import hexlify from django.conf import settings from django.contrib import messages from django.utils.deprecation import MiddlewareMixin -from django.utils.encoding import force_text from django.utils.functional import SimpleLazyObject from django.utils.translation import ugettext as _ from django.utils.six.moves.urllib import parse as urlparse @@ -66,7 +62,7 @@ class OpenedSessionCookieMiddleware(MiddlewareMixin): domain = app_settings.A2_OPENED_SESSION_COOKIE_DOMAIN if hasattr(request, 'user') and request.user.is_authenticated: response.set_cookie(name, value='1', max_age=None, domain=domain, - secure=app_settings.A2_OPENED_SESSION_COOKIE_SECURE) + secure=app_settings.A2_OPENED_SESSION_COOKIE_SECURE) elif app_settings.A2_OPENED_SESSION_COOKIE_NAME in request.COOKIES: response.delete_cookie(name, domain=domain) return response