1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Added request.session.delete_test_cookie()

git-svn-id: http://code.djangoproject.com/svn/django/trunk@669 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty
2005-09-23 01:28:44 +00:00
parent 3dc1ede871
commit 39a907a051
4 changed files with 13 additions and 1 deletions

View File

@@ -81,6 +81,7 @@ class AdminUserRequired:
request.user = user
return
else:
request.session.delete_test_cookie()
return httpwrappers.HttpResponseRedirect(request.path)
else:
return self.display_login_form(request, ERROR_MESSAGE)

View File

@@ -30,6 +30,9 @@ class SessionWrapper(object):
def test_cookie_worked(self):
return self.get(TEST_COOKIE_NAME) == TEST_COOKIE_VALUE
def delete_test_cookie(self):
del self[TEST_COOKIE_NAME]
def _get_session(self):
# Lazily loads session from storage.
try: