Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

130
Visualizações
where should I store user preferences or uers settings - localStorage or cookies?

I know this would vary depending on specific use cases but I want to know what the standard practices are. Let's say we have a darkmode option on our website and users can toggle it. And this change should be preserved. then I guess

  1. if we require the users to log in and the changes should persist between different devices then we should use cookies to send the user settings and store it somewhere in the backend?
  2. if we do not require the user to log in and we just want it to persist on this particular device then we can just store it in the localStorage? Are there any good articles or blog posts I can read on this topic? Also if we are using SSR and we decide to store it in localStorage. Does that mean the user might first see a wrong theme and then once the HTML gets rehydrated they can see the correct theme?
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda