zoukankan      html  css  js  c++  java
  • django的settings.py设置session

    ############
    # SESSIONS #
    ############
    
    SESSION_CACHE_ALIAS = 'default'                         # Cache to store session data if using the cache session backend.
    SESSION_COOKIE_NAME = 'sessionid'                       # Cookie name. This can be whatever you want.
    SESSION_COOKIE_AGE = 60 * 5                             # Age of cookie, in seconds (default: 2 weeks). Now is 5 minutes.
    SESSION_COOKIE_DOMAIN = None                            # A string like ".example.com", or None for standard domain cookie.
    SESSION_COOKIE_SECURE = False                           # Whether the session cookie should be secure (https:// only).
    SESSION_COOKIE_PATH = '/'                               # The path of the session cookie.
    SESSION_COOKIE_HTTPONLY = True                          # Whether to use the non-RFC standard httpOnly flag (IE, FF3+, others)
    SESSION_SAVE_EVERY_REQUEST = False                      # Whether to save the session data on every request.
    SESSION_EXPIRE_AT_BROWSER_CLOSE = True                  # Whether a user's session cookie expires when the Web browser is closed.
    SESSION_ENGINE = 'django.contrib.sessions.backends.db'  # The module to store session data
    SESSION_FILE_PATH = None                                # Directory to store session files if using the file session module. If None, the backend will use a sensible default.
    SESSION_SERIALIZER = 'django.contrib.sessions.serializers.JSONSerializer'  # class to serialize session data
  • 相关阅读:
    栈的操作总结
    C语言复习大纲
    生理周期
    石子合并
    幸运数字
    最长&最短文本
    C++引用
    C++入门
    直角三角形
    思维的囚徒--读书摘记和自己的肤浅解读--2021.1
  • 原文地址:https://www.cnblogs.com/linn/p/3895542.html
Copyright © 2011-2022 走看看