Ticket #2133: session.diff
File session.diff, 3.1 KB (added by , 18 years ago) |
---|
-
django/conf/global_settings.py
246 246 SESSION_COOKIE_DOMAIN = None # A string like ".lawrence.com", or None for standard domain cookie. 247 247 SESSION_SAVE_EVERY_REQUEST = False # Whether to save the session data on every request. 248 248 SESSION_EXPIRE_AT_BROWSER_CLOSE = False # Whether sessions expire when a user closes his browser. 249 SESSION_COMPLAIN_IF_INVALID = False # Whether to raise an error if the session cookie doesn't authenticate (instead of just ignoring it) 249 250 250 251 ######### 251 252 # CACHE # -
django/contrib/sessions/middleware.py
60 60 # Set the session_key to None to force creation of a new 61 61 # key, for extra security. 62 62 self.session_key = None 63 except SuspiciousOperation: 64 if settings.SESSION_COMPLAIN_IF_INVALID: 65 raise 66 self._session_cache = {} 67 self.session_key = None 63 68 return self._session_cache 64 69 65 70 _session = property(_get_session) -
docs/sessions.txt
241 241 242 242 The name of the cookie to use for sessions. This can be whatever you want. 243 243 244 SESSION_SAVE_EVERY_REQUEST 245 -------------------------- 246 247 Default: ``False`` 248 249 Whether to save the session data on every request. If this is ``False`` 250 (default), then the session data will only be saved if it has been modified -- 251 that is, if any of its dictionary values have been assigned or deleted. 252 253 .. _Django settings: http://www.djangoproject.com/documentation/settings/ 254 244 255 SESSION_EXPIRE_AT_BROWSER_CLOSE 245 256 ------------------------------- 246 257 … … 249 260 Whether to expire the session when the user closes his or her browser. See 250 261 "Browser-length sessions vs. persistent sessions" above. 251 262 252 SESSION_ SAVE_EVERY_REQUEST253 -------------------------- 263 SESSION_COMPLAIN_IF_INVALID 264 --------------------------- 254 265 255 266 Default: ``False`` 256 267 257 Whether to save the session data on every request. If this is ``False`` 258 (default), then the session data will only be saved if it has been modified -- 259 that is, if any of its dictionary values have been assigned or deleted. 268 Whether to raise an error if the session cookie doesn't authenticate 269 correctly. This can happen two ways: either you change a site's 270 ``SECRET_KEY``, or someone tries to hack your site by creating a 271 cookie of their own. By default, Django will ignore invalid cookies, 272 and act as if the client didn't present a cookie at all. Turning this 273 flag on will make warn the user that the cookie their browser sent was 274 invalid. 260 275 261 .. _Django settings: http://www.djangoproject.com/documentation/settings/262 263 276 Technical details 264 277 ================= 265 278