What is the main difference between localStorage and sessionStorage?
Local Storage | Session Storage |
---|---|
A type of Web Storage Object used in HTML 5 which allows users to store data without any expiry date. | Session Storage is another part of web storage that allows users to store data pertaining to only one session. |
It is used particularly in environments where data needs to be transferred in multiple windows and should last more than the current session. | It allows users to carry out a single transaction but it can be carried out parallelly in multiple windows. |
BY Best Interview Question ON 20 Sep 2020