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
  • 相关阅读:
    1043. 输出PATest(20)
    1042. 字符统计(20)
    1041. 考试座位号(15)
    1040. 有几个PAT(25)
    1035. 插入与归并(25)
    栈:火车进站
    ABC Fennec VS. Snuke
    费解的开关
    最短Hamilton路径
    built?
  • 原文地址:https://www.cnblogs.com/linn/p/3895542.html
Copyright © 2011-2022 走看看