time-out setting for session
In Settings
session_cookie_age=60*30 30 minutes. Session_expire_at_browser_close False: Session cookies can remain valid in the user's browser. True: The cookie expires if the browser is closed. Session_cookie_domain effective Site Session_cookie_name The name of the session stored in the COOKIE
Session use is relatively simple, in Request.session is a dictionary class. The session is saved in the database.
-------------------------------------------------------
The "Session_cookie_age" and "Session_expire_at_browser_close" in the settings.py are not valid according to the manual and the online method. By looking at the Django source code "middleware.py" We know that these two parameters are only available in settings. Valid only if Session_save_every_request is true. The problem is resolved after setting this variable in settings.py. Session_cookie_age does not take effect if Session_expire_at_browser_close is true from source code. This means that the user can only select one two, when the browser is closed to invalidate the session or timeout.
--------------------------------------------------------------
The following method is not used in settings.
Request.session.set_expiry (value)
You can pass four different values to it:
* If value is an integer, the session will expire after a few seconds (applicable to the entire Django framework, where the entire page will expire when the value is aging).
* If value is a datatime or timedelta,session, it will expire after this time.
* If value is 0, the user closes the browser session will expire.
* if value is none,session it will depend on the global session expiration policy.