In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Django has some default generic configurations for Session, which are:
SESSION_COOKIE_NAME = "sessionid" # cookie saved on the browser keySESSION_COOKIE_PATH = "/" # Session cookie saved path (default) SESSION_COOKIE_DOMAIN = None # Session cookie saved domain name (default) SESSION_COOKIE_SECURE = False # whether Https transfer cookieSESSION_COOKIE_HTTPONLY = True # whether Session cookie only supports http Transfer (default) SESSION_COOKIE_AGE = 1209600 # cookie expiration date of Session (2 weeks) (default) SESSION_SAVE_EVERY_REQUEST = False # whether to close the browser so that Session expires SESSION_COOKIE_AT_BROWSER_CLOSE = False # whether to save Session every request Can not be saved until it is modified by default
These configurations can be written and changed in the settings.py file
In Django, Session can be saved in a database, in a buffer, or in a file. By default, it is saved in a database with a Sessions table. You can modify how session is saved by modifying the settings.py file.
Saved in the database by default: SESSION_ENGINE = 'django.contrib.sessions.backends.db' saved in the file SESSION_ENGINE =' django.contrib.sessions.backends.file' saved in the cache SESSION_ENGINE = 'django.contrib.sessions.backends.cache' saved to both the cache and the database SESSION_ENGINE =' django.contrib.sessions.backends.cache_db'
Django's operation on Session:
Request.session.set_expiry (value) if value is an integer, session will expire after these seconds. If value is a datatime or timedelta,session, it will fail after this time. If value is 0, the user closes the browser session will fail if value is None. Session relies on the global session failure policy request.session.delete ("session_key") to delete all session data of the current user. Request.session.clear () clears all sessionrequest.session ['K1'] request.session.get (' K1NiNone) request.session ['K1'] = 123.If it exists, it updates the request.session.setdefault ("K1BQ 123") and does not set it.
Reference: http://blog.csdn.net/clh704/article/details/9186465
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 248
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.