How to set a cookie from masterPage.js?

I am new to using masterPage.js and I thought that this would work:

export function text151_click ( event ) {
document.cookie = ‘CookieConsent=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;’;
}

But I can now see that ‘document’ isn´t accessible. Is there another way to set or update a cookie?

It seems like you can’t use cookies on Wix. No one from their team is ever explaining how to work with cookies.