Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

126
Vistas
Getting a 'SameSite' cookie warning when I set my own cookies

I'm using the following code to set a cookie

function setCookie(key, value, path, time) {
if (time != '') {
    var expires = new Date();
    expires.setTime(expires.getTime() + time);
    document.cookie = key + '=' + value + ';path=' + path + ';expires=' + expires.toUTCString();
}

This code works just fine, but I'm getting a warning in the console that says...

Cookie “cookie_name” 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, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite

I tried adding 'samesite=lax' to the last line in the code above after the expires value, but that didn't seem to have any effect. What do I need to do in order to eliminate this warning?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda