Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Internet > HTTP (WWW)

    cookiesession 0.1

    Download button

    No screenshots available
    Downloads: 234  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Justin Quick | More programs
    The Apache License 2.0 / FREE
    November 10th, 2009, 14:21 GMT
    ROOT / Internet / HTTP (WWW)

     Read user reviews (0)  Refer to a friend  Subscribe

    cookiesession description

    A secure way to hold Django session data in cookies

    cookiesession contains a drop-in replacement middleware for django.contrib.sessions.middleware.SessionMiddleware to store all session data in a browser cookie instead of the database. The code is based on a snippet from Christopher Lenz.

    To prevent user tampering the session dictionary goes through the following encoding steps:

    1. The session dictionary is converted into json
    2. A sha1 hash is made with the json and the site's SECRET_KEY
    3. The json and sha1 hash are concatenated, gzipped and base64 encoded.

    Upon decoding:

    1. The cookie is base64 decoded and ungzipped
    2. The data is split into the sha1 hash and the json data
    3. The sha1 hash is regenerated from the received json data and the site's SECRET_KEY
    4. If the hashes don't match, a SuspiciousOperation exception is raised. If the hashes match, the json data is converted into a python object and returned.

    Management Commands

    Two management commands are included to make debugging things easier.

    decode_session_cookie

    Called as ./manage.py decode_session_cookie and prints the keys and values of the session dictionary.

    encode_session_cookie

    Encodes key=val arguments into a cookie for manual insertion into your browser for testing purposes. You must call the command as ./manage.py encode_cookie key1=value key2=value


    Product's homepage

    Requirements:

    · Python
    · Django

      


    TAGS:

    Django session | session cookie | Django plugin | Django | session | cookie

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM