Kaydet (Commit) 8d307fb8 authored tarafından Georg Bauer's avatar Georg Bauer

fixes #1180 - added another random number to the get_new_session_key function to…

fixes #1180 - added another random number to the get_new_session_key function to prevent early duplicates


git-svn-id: http://code.djangoproject.com/svn/django/trunk@1851 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst 2bffee2e
......@@ -105,7 +105,7 @@ class Session(meta.Model):
# The random module is seeded when this Apache child is created.
# Use person_id and SECRET_KEY as added salt.
while 1:
session_key = md5.new(str(random.randint(0, sys.maxint - 1)) + SECRET_KEY).hexdigest()
session_key = md5.new(str(random.randint(0, sys.maxint - 1)) + str(random.randint(0, sys.maxint - 1)) + SECRET_KEY).hexdigest()
try:
get_object(session_key__exact=session_key)
except SessionDoesNotExist:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment