The law is not about cookies specifically, it's technology neutral. The law doesn't even include the word cookie anywhere.
https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX%3A...