Is there a way to block all cookies sent to client from a webpage using javascript? Is should not allow third-party cookies from iframes or other scripts as well.
I've thought about it, like a listener that triggers a set cookie event and block it.
Is there a way to block all cookies sent to client from a webpage using javascript? Is should not allow third-party cookies from iframes or other scripts as well.
I've thought about it, like a listener that triggers a set cookie event and block it.
No, it isn't possible.
You could fake it for the current domain by polling the cookies and deleting them as you spot them (this wouldn't work for cookies marked as http only) but you can't touch cookies from other origins using JavaScript.