1

Can Browsers Block Local Storage?

Disclaimer: Due to my lack of knowledge on the subject, my question may lack in details. I'll go ahead and revise it if necessary

Introduction

Hey everyone,

When I visit some websites, I get a notification saying "This website wants to leave you cookies" and below that I have the choice to allow or block that website.

I often use local storage to save small variables locally. I saw a cookie notification the other day and wondered if my local variables get blocked.

Question

Websites can block cookies, but can they block local variables as well?

Context

In my specific case, I'm using a countdown timer. In order to make things seem realistic, I'm saving the last value of the timer to local storage. That way, when users refresh the page, the countdown timer doesn't jump back up to its original value.

Thanks!

Community
  • 1
  • 1
Jacob
  • 890
  • 10
  • 30

1 Answers1

1

Sites can't block cookie storage, but they just ask you that to fulfill the cookie law:

The Cookie Law is a piece of privacy legislation that requires websites to get consent from visitors to store or retrieve any information on a computer, smartphone or tablet.

Same would go for DOM storage, but there's no "Browser Storage Law" for now...

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