There is no EU legislation that mandates cookie consent. In fact with the GDPR the old cookie-banner law that required you to inform of the usage of cookies was abolished. The cookie banners is the industries own perverted solution to the problem of asking for consent when there is no other legal basis for processing personal information.