File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ /*
2
+ properties and methods are similar to local storage.
3
+ Session storage exists in current browser tab only.
4
+ if we change the tabs, the session storage will be cleared.
5
+
6
+ The data survives the page refresh, but not closing/opening the tab.
7
+
8
+ STORAGE EVENT
9
+ When the data is updated in local or session storage, storage event must be triggered with the following properties:
10
+ 1- key
11
+ 2- old value
12
+ 3- new value
13
+ 4- url
14
+ 5- storageArea
15
+ */
16
+
17
+ // sessionStorage.getItem("name")
18
+ // sessionStorage.clear()
19
+ // sessionStorage.removeItem("name")
20
+ // sessionStorage.setItem("name", "harry")
21
+ // sessionStorage.removeItem("name")
22
+
23
+
24
+ window . onstorage = ( e ) => {
25
+ alert ( "changed" )
26
+ console . log ( e )
27
+ }
28
+
You can’t perform that action at this time.
0 commit comments