MCPcopy
hub / github.com/tornadoweb/tornado / get_signed_cookie_key_version

Method get_signed_cookie_key_version

tornado/web.py:934–954  ·  view source on GitHub ↗

Returns the signing key version of the secure cookie. The version is returned as int. .. versionchanged:: 6.3 Renamed from ``get_secure_cookie_key_version`` to ``set_signed_cookie_key_version`` to avoid confusion with other uses of "secure" in cook

(
        self, name: str, value: Optional[str] = None
    )

Source from the content-addressed store, hash-verified

932 get_secure_cookie = get_signed_cookie
933
934 def get_signed_cookie_key_version(
935 self, name: str, value: Optional[str] = None
936 ) -> Optional[int]:
937 """Returns the signing key version of the secure cookie.
938
939 The version is returned as int.
940
941 .. versionchanged:: 6.3
942
943 Renamed from ``get_secure_cookie_key_version`` to
944 ``set_signed_cookie_key_version`` to avoid confusion with other
945 uses of "secure" in cookie attributes and prefixes. The old name
946 remains as an alias.
947
948 """
949 self.require_setting("cookie_secret", "secure cookies")
950 if value is None:
951 value = self.get_cookie(name)
952 if value is None:
953 return None
954 return get_signature_key_version(value)
955
956 get_secure_cookie_key_version = get_signed_cookie_key_version
957

Callers

nothing calls this directly

Calls 3

require_settingMethod · 0.95
get_cookieMethod · 0.95

Tested by

no test coverage detected