=== modified file 'django/conf/global_settings.py'
|
|
|
273 | 273 | SESSION_COOKIE_NAME = 'sessionid' # Cookie name. This can be whatever you want. |
274 | 274 | SESSION_COOKIE_AGE = 60 * 60 * 24 * 7 * 2 # Age of cookie, in seconds (default: 2 weeks). |
275 | 275 | SESSION_COOKIE_DOMAIN = None # A string like ".lawrence.com", or None for standard domain cookie. |
| 276 | SESSION_COOKIE_PATH = '/' # A string "/shop". Only use if you host two different djang instances on the same domain |
276 | 277 | SESSION_COOKIE_SECURE = False # Whether the session cookie should be secure (https:// only). |
277 | 278 | SESSION_SAVE_EVERY_REQUEST = False # Whether to save the session data on every request. |
278 | 279 | SESSION_EXPIRE_AT_BROWSER_CLOSE = False # Whether sessions expire when a user closes his browser. |
=== modified file 'django/contrib/sessions/middleware.py'
|
|
|
109 | 109 | datetime.datetime.now() + datetime.timedelta(seconds=settings.SESSION_COOKIE_AGE)) |
110 | 110 | response.set_cookie(settings.SESSION_COOKIE_NAME, session_key, |
111 | 111 | max_age=max_age, expires=expires, domain=settings.SESSION_COOKIE_DOMAIN, |
| 112 | path=settings.SESSION_COOKIE_PATH, |
112 | 113 | secure=settings.SESSION_COOKIE_SECURE or None) |
113 | 114 | return response |
=== modified file 'docs/settings.txt'
|
|
|
752 | 752 | The name of the cookie to use for sessions. This can be whatever you want. |
753 | 753 | See the `session docs`_. |
754 | 754 | |
| 755 | SESSION_COOKIE_PATH |
| 756 | ------------------- |
| 757 | |
| 758 | Default: ``'/'`` |
| 759 | |
| 760 | The path set for the cookie. This is usefull if you have multiple Django instances, that |
| 761 | are running at different URL mount points within the same virtual host. |
| 762 | |
755 | 763 | SESSION_COOKIE_SECURE |
756 | 764 | --------------------- |
757 | 765 | |