A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/django/django/commit/31cb25adecba930bdeee4556709f5a1c42d88fd6 below:

[1.8.x] Fixed incorrect session.flush() in cached_db session backend. · django/django@31cb25a · GitHub

File tree Expand file treeCollapse file tree 3 files changed

+19

-2

lines changed

Filter options

Expand file treeCollapse file tree 3 files changed

+19

-2

lines changed Original file line number Diff line number Diff line change

@@ -79,7 +79,7 @@ def flush(self):

79 79

"""

80 80

self.clear()

81 81

self.delete(self.session_key)

82 -

self._session_key = ''

82 +

self._session_key = None

83 83 84 84

# At bottom to avoid circular import

85 85

from django.contrib.sessions.models import Session # isort:skip

Original file line number Diff line number Diff line change

@@ -4,7 +4,23 @@ Django 1.8.2 release notes

4 4 5 5

*Under development*

6 6 7 -

Django 1.8.2 fixes several bugs in 1.8.1.

7 +

Django 1.8.2 fixes a security issue and several bugs in 1.8.1.

8 + 9 +

Fixed session flushing in the ``cached_db`` backend

10 +

===================================================

11 + 12 +

A change to ``session.flush()`` in the ``cached_db`` session backend in Django

13 +

1.8 mistakenly sets the session key to an empty string rather than ``None``. An

14 +

empty string is treated as a valid session key and the session cookie is set

15 +

accordingly. Any users with an empty string in their session cookie will use

16 +

the same session store. ``session.flush()`` is called by

17 +

``django.contrib.auth.logout()`` and, more seriously, by

18 +

``django.contrib.auth.login()`` when a user switches accounts. If a user is

19 +

logged in and logs in again to a different account (without logging out) the

20 +

session is flushed to avoid reuse. After the session is flushed (and its

21 +

session key becomes ``''``) the account details are set on the session and the

22 +

session is saved. Any users with an empty string in their session cookie will

23 +

now be logged into that account.

8 24 9 25

Bugfixes

10 26

========

Original file line number Diff line number Diff line change

@@ -162,6 +162,7 @@ def test_flush(self):

162 162

self.session.flush()

163 163

self.assertFalse(self.session.exists(prev_key))

164 164

self.assertNotEqual(self.session.session_key, prev_key)

165 +

self.assertIsNone(self.session.session_key)

165 166

self.assertTrue(self.session.modified)

166 167

self.assertTrue(self.session.accessed)

167 168

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4