MCPcopy Create free account
hub / github.com/EasyIME/PIME / clear_cookie

Method clear_cookie

python/python3/tornado/web.py:655–669  ·  view source on GitHub ↗

Deletes the cookie with the given name. Due to limitations of the cookie protocol, you must pass the same path and domain to clear a cookie as were used when that cookie was set (but there is no way to find out on the server side which values were used for a given co

(
        self, name: str, path: str = "/", domain: Optional[str] = None
    )

Source from the content-addressed store, hash-verified

653 morsel[k] = v
654
655 def clear_cookie(
656 self, name: str, path: str = "/", domain: Optional[str] = None
657 ) -> None:
658 """Deletes the cookie with the given name.
659
660 Due to limitations of the cookie protocol, you must pass the same
661 path and domain to clear a cookie as were used when that cookie
662 was set (but there is no way to find out on the server side
663 which values were used for a given cookie).
664
665 Similar to `set_cookie`, the effect of this method will not be
666 seen until the following request.
667 """
668 expires = datetime.datetime.utcnow() - datetime.timedelta(days=365)
669 self.set_cookie(name, value="", path=path, expires=expires, domain=domain)
670
671 def clear_all_cookies(self, path: str = "/", domain: Optional[str] = None) -> None:
672 """Deletes all the cookies the user sent with this request.

Callers 2

clear_all_cookiesMethod · 0.95

Calls 1

set_cookieMethod · 0.95

Tested by

no test coverage detected