def main(request, response): """Respond to `/cookies/resources/dropSameSiteNone.py by dropping the two cookies set by setSameSiteNone.py""" headers = setNoCacheAndCORSHeaders(request, response) # Expire the cookies, and return a JSON-encoded success code. headers.append(makeDropCookie("samesite_none_insecure", False)) headers.append(makeDropCookie("samesite_none_secure", True)) return headers, '{"success": true}'
def main(request, response): """Respond to `/cookie/drop/secure` by dropping the two cookie set by `setSecureTestCookies()`""" headers = setNoCacheAndCORSHeaders(request, response) # Expire the cookies, and return a JSON-encoded success code. headers.append(makeDropCookie("alone_secure", False)) headers.append(makeDropCookie("alone_insecure", False)) return headers, '{"success": true}'
def main(request, response): """Respond to `/cookie/same-site/resources/dropSameSite.py by dropping the four cookies set by setSameSiteCookies.py""" headers = setNoCacheAndCORSHeaders(request, response) # Expire the cookies, and return a JSON-encoded success code. headers.append(makeDropCookie(b"samesite_strict", False)) headers.append(makeDropCookie(b"samesite_lax", False)) headers.append(makeDropCookie(b"samesite_none", False)) headers.append(makeDropCookie(b"samesite_unspecified", False)) return headers, b'{"success": true}'
def main(request, response): """Respond to `/cookie/same-site/resources/dropSameSite.py by dropping the four cookies set by setSameSiteCookies.py""" headers = setNoCacheAndCORSHeaders(request, response) # Expire the cookies, and return a JSON-encoded success code. headers.append(makeDropCookie("samesite_strict", False)) headers.append(makeDropCookie("samesite_lax", False)) headers.append(makeDropCookie("samesite_none", False)) headers.append(makeDropCookie("samesite_unspecified", False)) return headers, '{"success": true}'
def main(request, response): """Respond to `/cookie/drop?name={name}` by expiring the cookie named `{name}`.""" headers = setNoCacheAndCORSHeaders(request, response) try: # Expire the named cookie, and return a JSON-encoded success code. name = readParameter(request, paramName="name", requireValue=True) scheme = request.url_parts.scheme headers.append(makeDropCookie(name, "https" == scheme)) return headers, '{"success": true}' except: return 500, headers, '{"error" : "Empty or missing name parameter."}'
def main(request, response): """Respond to `/cookie/drop?name={name}` by expiring the cookie named `{name}`.""" headers = setNoCacheAndCORSHeaders(request, response) try: # Expire the named cookie, and return a JSON-encoded success code. name = readParameter(request, paramName=u"name", requireValue=True) scheme = request.url_parts.scheme headers.append(makeDropCookie(name, u"https" == scheme)) return headers, b'{"success": true}' except: return 500, headers, b'{"error" : "Empty or missing name parameter."}'