Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript Storage.setItem() key clash scenario

Tags:

javascript

I am about to use Storage.setItem() in one of my Angular project but wanted to check how does browser handle the scenario when two separate web apps try to set the storage with the same key.

  1. Does the previous value get overridden?
  2. Or does the browser have a way to seperate out storage for each individual web-application
like image 642
java_doctor_101 Avatar asked Jan 29 '26 06:01

java_doctor_101


1 Answers

localStorage is set on a per domain basis. So keys won't clash if they are on different web applications in my opinion. See In HTML5, is the localStorage object isolated per page/domain?

like image 133
KalyanLahkar Avatar answered Jan 30 '26 20:01

KalyanLahkar