Ticket #4724: session_cookie_path.patch

File session_cookie_path.patch, 1.9 KB (added by frej, 17 years ago)
  • django/conf/global_settings.py

    === modified file 'django/conf/global_settings.py'
     
    276276SESSION_COOKIE_SECURE = False             # Whether the session cookie should be secure (https:// only).
    277277SESSION_SAVE_EVERY_REQUEST = False        # Whether to save the session data on every request.
    278278SESSION_EXPIRE_AT_BROWSER_CLOSE = False   # Whether sessions expire when a user closes his browser.
     279SESSION_COOKIE_PATH = '/'                 # A string setting the path of the session cookie.
    279280
    280281#########
    281282# CACHE #
  • django/contrib/sessions/middleware.py

    === modified file 'django/contrib/sessions/middleware.py'
     
    109109                    datetime.datetime.now() + datetime.timedelta(seconds=settings.SESSION_COOKIE_AGE))
    110110                response.set_cookie(settings.SESSION_COOKIE_NAME, session_key,
    111111                    max_age=max_age, expires=expires, domain=settings.SESSION_COOKIE_DOMAIN,
     112                    path=settings.SESSION_COOKIE_PATH,
    112113                    secure=settings.SESSION_COOKIE_SECURE or None)
    113114        return response
  • docs/settings.txt

    === modified file 'docs/settings.txt'
     
    752752The name of the cookie to use for sessions. This can be whatever you want.
    753753See the `session docs`_.
    754754
     755SESSION_COOKIE_PATH
     756-------------------
     757
     758Default: ``'/'``
     759
     760The path set on the session cookie. Should match the URL path of your
     761Django installation. Useful if you want to keep other people using the same
     762domain name from accessing Django session cookies. If hosting a django
     763instance at www.example.com/foo then set path to "/foo".
     764
    755765SESSION_COOKIE_SECURE
    756766---------------------
    757767
Back to Top