You might want to look if this module might solve your problem: Cookies module https://marketplace.mendix.com/link/component/115305
Regards,
Ronald