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

128
Vistas
Use cookies that are not sent to server?

I'm building a site that has a few user options like dark or light mode (overriding the system default), default to X layout instead of Y, etc. None of these options need to be sent to the server. Is there a way that my JS can set cookies that aren't set to server? I was thinking maybe local storage is the solution but I know people get annoyed when they clear cookies and settings stick around (because local storage != cookie)

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

0

Is there a way that my JS can set cookies that aren't set to server?

Not as far as I'm aware. Any cookies that are visible to the site (which is what you'd want if you need to read them in JS) will be sent with any requests to the server. Unless you specifically add logic server-side which looks at those cookie values though, it likely won't actually do anything even if you do send them to the server.

You could use sessionStorage instead of localStorage if you don't mind it being cleared out when users close the tab (see https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage).

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