MCPcopy
hub / github.com/django/django / delete_cookie

Method delete_cookie

django/http/response.py:290–306  ·  view source on GitHub ↗
(self, key, path="/", domain=None, samesite=None)

Source from the content-addressed store, hash-verified

288 return self.set_cookie(key, value, **kwargs)
289
290 def delete_cookie(self, key, path="/", domain=None, samesite=None):
291 # Browsers can ignore the Set-Cookie header if the cookie doesn't use
292 # the secure flag and:
293 # - the cookie name starts with "__Host-" or "__Secure-", or
294 # - the samesite is "none".
295 secure = key.startswith(("__Secure-", "__Host-")) or (
296 samesite and samesite.lower() == "none"
297 )
298 self.set_cookie(
299 key,
300 max_age=0,
301 path=path,
302 domain=domain,
303 secure=secure,
304 expires="Thu, 01 Jan 1970 00:00:00 GMT",
305 samesite=samesite,
306 )
307
308 # Common methods used by subclasses
309

Calls 1

set_cookieMethod · 0.95