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

408
Visualizações
Why does Safari (both macOS and iOS) randomly drop cookies and local storage?

I have a website where I store an authentication token in a cookie with 5-year expiration. Despite that, both desktop and mobile Safari tends to drop this cookie from time to time (sometime it lasts for 2 months, sometime it gets removed in a week). This is very unpredictable to my users.

I also tried storing the same token in Local Storage instead of a Cookie, the result is exactly the same.

Both the cookie and the local storage item are set by JavaScript / AngularJS on the client side:

window.localStorage.setItem('token', 'secret-token');
angular.module('app', ['ngCookies'])
.controller('Ctrl', ['$cookies', function($cookies) {
  var expireDate = new Date();
  expireDate.setDate(expireDate.getDate() + 5*365);
  $cookies.put('token', 'secret-token', { 'expires': expireDate });
}]);

I haven't found any documentation describing this especially random behaviour.

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