The lack of experience I have has brought me here. I want to use cookies to save the user's theme, but I get this warning message in console: 'Cookie “” will be soon rejected because it has the “SameSite” attribute set to “None” or an invalid value, without the “secure” attribute. To know more about the “SameSite“ attribute'
I have read some documentation and it says I should put this 'Set-Cookie: flavor=choco; SameSite=None; Secure' in my code, but I don't know where exactly, since it is not JS (which I use to GET and SET the cookies). So, what should I do to get over this problem?
Edit: I use client-side JS only, I do not use any library, just plain and basic code. I set the cookies through document.cookie = some string and then splitting them apart with .split().
function setcookie(theme, page){
document.cookie = theme + ' ' + page;
}
function getcookie(value){
let str = document.cookie.split(' ');
return str[value];
}