How to delete _pk_id and _pk_ses cookies?

I’m trying to delete these cookies when users revoke the required consent, but unable to delete. What could be the reason?

how are you trying to delete those cookies? There is a function to achieve that:

paq.push(["deleteCookies"]);

you can also check if cookies are present, disable them so no new cookies are created with the next tracking request and a few other things. API — Piwik PRO Analytics Suite 16.33 documentation has everything you need to know.

Hope that helps,

best,
Markus