Some laws such as the GDPR and the EU ePrivacy Directive require that you obtain consent before using cookies, except for those cookies that are strictly necessary for a website to function.