User consent is basically the user’s permission to collect and handle their data. Getting a user’s consent before using cookies is mandatory under laws such as the General Data Protection Regulation (GDPR). On the other hand, laws like the California Consumer Protection Act (CCPA) allow you to use cookies before you get consent, as long as you make it clear and easy for a user to opt out.