]> git.mxchange.org Git - fba.git/blobdiff - fba/helpers/cookies.py
Continued:
[fba.git] / fba / helpers / cookies.py
index 5a35602bda672028f32f56088832742f35643926..2ed3f1d7a79763a07496ebb4280c9a4f894af77e 100644 (file)
@@ -53,3 +53,16 @@ def has (domain: str) -> bool:
 
     # DEBUG: print(f"DEBUG: has_cookies='{has_cookies}' - EXIT!")
     return has_cookies
+
+def clear (domain: str):
+    # DEBUG: print(f"DEBUG: domain='{domain}' - CALLED!")
+    if not isinstance(domain, str):
+        raise ValueError(f"Parameter domain[]='{type(domain)}' is not 'str'")
+    elif domain == "":
+        raise ValueError("Parameter 'domain' is empty")
+
+    if has(domain):
+        # DEBUG: print(f"DEBUG: Removing cookies for domain='{domain}' ...")
+        del _cookies[domain]
+
+    # DEBUG: print(f"DEBUG: EXIT!")