In the EU and UK, non-essential cookies and similar storage require freely given, informed, specific, and unambiguous opt-in consent before they are set.
EDPB Guidelines 03/2022 on deceptive design patterns in social media
CNIL — Cookies and other tracking devices: new guidelines
ePrivacy Directive 2002/58/EC, Article 5(3)