The law requires user consent, in form of a click on a banner or scrolling the page, before setting any cookie.
http://eur-lex.europa.eu/legal-content/EN/ALL/?uri=CELEX:320...
Complete law: http://eur-lex.europa.eu/legal-content/EN/TXT/PDF/?uri=CELEX...
Paragraph 66 talks about cookies.
A later exception was made by the EU for session cookies.
Guidelines for webmasters:
http://ec.europa.eu/ipg/basics/legal/cookies/index_en.htm#se...
It has a sample banner which is similar to those which most users display.
Spanish official directives (with further protection because of a local law called LSSI): https://www.agpd.es/portalwebAGPD/canaldocumentacion/publica..., page 17. Also comes with a sample banner
Did you really think that everyone else was wrong or didn't read the law and is programming these banners as some sort of fad?
However, OP is right, governments spy on our webcams and analyze our traffic, and that's ok, but we need a stupid banner that overrides browser preferences to avoid all but session cookies. Duh.
If the cookies are used for tracking, like Google Analytics, then yes, it needs to ask the user for consent.
And that’s not a warning, but actual "yes/no", and in the no case, it may not set a tracking cookie, or have set a tracking cookie already.
Most sites (except for a few dozen German and Dutch ones) just redirect you somewhere else, though, if you refuse to be tracked.