Django

Code

Changeset 1851

Show
Ignore:
Timestamp:
01/07/06 05:07:52 (3 years ago)
Author:
hugo
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/models/core.py

    r1166 r1851  
    106106        # Use person_id and SECRET_KEY as added salt. 
    107107        while 1: 
    108             session_key = md5.new(str(random.randint(0, sys.maxint - 1)) + SECRET_KEY).hexdigest() 
     108            session_key = md5.new(str(random.randint(0, sys.maxint - 1)) + str(random.randint(0, sys.maxint - 1)) + SECRET_KEY).hexdigest() 
    109109            try: 
    110110                get_object(session_key__exact=session_key)