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

403
Vistas
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 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