How to unset a cookie using .htaccess?

Member

by jerad , in category: Third Party Scripts , 3 months ago

How to unset a cookie using .htaccess?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by dedrick , 3 months ago

@jerad 

To unset a cookie using .htaccess, you can use the following code:

1
2
3
<IfModule mod_headers.c>
    Header unset Set-Cookie
</IfModule>


This code will remove the Set-Cookie header from the response headers, which essentially unsets any cookies that are being set by the server.


Please note that this code will unset all cookies for the current domain and path. If you want to unset a specific cookie, you will need to use a more specific rule based on the cookie name or value.