2

What should I use for store data client-side so that datas wouldn't be deleted when clearing browsers history? Is there any way to do that?

2 Answers2

0

Clearing the browser's history does just that. It doesn't clear cookies or local storage. But localStorage is probably your best bet if you meant clearing cookies as localStorage is not cleared by clearing cookies. See this for more.

Scott Marcus
  • 64,069
  • 6
  • 49
  • 71
  • Thank You for your answer, unfortunelly I read that localStorage is deleted when browsers history got deleted. Here is the link to that post: http://stackoverflow.com/questions/26512449/does-localstorage-in-javascript-get-wiped-off-after-clearing-browser-history – daniel1234567 Dec 01 '16 at 21:17
  • That post is misleading. When clearing the browser's history, just the history is cleared. However, often when clear history is clicked, the option to clear other resources is also offered and if the user has those other resources checked, then yes, those other resources will be cleared. – Scott Marcus Dec 01 '16 at 21:25
0

Actually Indexed DB is the standard browser-side storage approach which doesn't get dropped when user clears browser's history.

See these related Q&As:

This still true for major browsers for now. Maybe I'll need to retract this answer in a while...

Community
  • 1
  • 1
Matías Fidemraizer
  • 63,804
  • 18
  • 124
  • 206