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

246
Vistas
Unclear how to read cookie properties and use in conditionals -

I'm using js-cookie:

It's easy to set a cookie, but I'm unclear how to output specific values and test against them. This works fine:

Cookies.set('newsletter', 'show', { expires: 30, path: '/' });
var myCookie = Cookies.get('newsletter');

But this does not:

if(myCookie){
  var p = Cookies.get(['expires']);
  document.write(p);
}

How do I access the expires property?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

According to this issue it is not possible

It‘s not possible.

Also in the FAQ it states the same thing:

It's not possible. Once the cookie has been written, its attributes can‘t be read out. The underlying API we‘re constraint to use doesn‘t support this: https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie

about 4 years ago · Juan Pablo Isaza Denunciar
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