This commit is contained in:
@@ -15,7 +15,8 @@ function setCookie(name, value, days = 30) {
|
||||
const date = new Date()
|
||||
date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000)
|
||||
const expires = `expires=${date.toUTCString()}`
|
||||
document.cookie = `${name}=${encodeURIComponent(value)};${expires};path=/;SameSite=Lax`
|
||||
const secureFlag = window.location.protocol === 'https:' ? ';Secure' : ''
|
||||
document.cookie = `${name}=${encodeURIComponent(value)};${expires};path=/;SameSite=Lax${secureFlag}`
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user