import os
import json
def invalidate_cookies(cookie_file_path):
"""Invalidates cookies by deleting the cookie file."""
try:
os.remove(cookie_file_path)
print(f"Cookie file '{cookie_file_path}' invalidated.") # Verbose log
except FileNotFoundError:
print(f"Cookie file '{cookie_file_path}' not found.") # Verbose log
except Exception as e:
print(f"Error invalidating cookie file '{cookie_file_path}': {e}") # Verbose log
def main():
"""Main function to handle cookie invalidation."""
cookie_file = os.path.join(os.path.expanduser("~"), ".cookie") # Default cookie file path
# Check if the cookie file exists
if os.path.exists(cookie_file):
invalidate_cookies(cookie_file)
else:
print("No cookie file found.") #Verbose log
if __name__ == "__main__":
main()
Add your comment