Ticket #4724: session_cookie_path.2.patch

File session_cookie_path.2.patch, 2.1 KB (added by frej, 17 years ago)

Oops - fix the doc part of the patch

  • django/conf/global_settings.py

    === modified file 'django/conf/global_settings.py'
     
    273273SESSION_COOKIE_NAME = 'sessionid'         # Cookie name. This can be whatever you want.
    274274SESSION_COOKIE_AGE = 60 * 60 * 24 * 7 * 2 # Age of cookie, in seconds (default: 2 weeks).
    275275SESSION_COOKIE_DOMAIN = None              # A string like ".lawrence.com", or None for standard domain cookie.
     276SESSION_COOKIE_PATH = '/'                 # A string "/shop". Only use if you host two different djang instances on the same domain
    276277SESSION_COOKIE_SECURE = False             # Whether the session cookie should be secure (https:// only).
    277278SESSION_SAVE_EVERY_REQUEST = False        # Whether to save the session data on every request.
    278279SESSION_EXPIRE_AT_BROWSER_CLOSE = False   # Whether sessions expire when a user closes his browser.
  • 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 for the cookie. This is usefull if you have multiple Django instances, that
     761are running at different URL mount points within the same virtual host.
     762
    755763SESSION_COOKIE_SECURE
    756764---------------------
    757765
Back to Top