Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

How to check cookies, local storage and session storage?


Asked by Hezekiah Dalton on Dec 07, 2021 FAQ



To check cookies in Chrome you must press F12 button on your keyboard. In Opera you must click CTRL + SHIFT + I. Further, in both browsers, switch tab to “Application”. Here in left hand side column you can find “Local Storage” and “Session Storage” and explore it. To check cookies in Firefox you must press F12 button on your keyboard.
In this manner,
The sessionStorage object stores data only for a session, meaning that the data is stored until the browser (or tab) is closed. Data is never transferred to the server. Storage limit is larger than a cookie (at least 5MB).
Furthermore, The browser makes a request to the server to fetch required assets, but some times, you need some data saved locally. In cases like sessions and cookies, the local data interacts with the server and in cases like local storage, it helps the browser get data faster. You made it to the end!
Likewise,
localStorage, sessionStorage, and cookies are all client storage solutions. Session data is held on the server where it remains under your direct control.
Subsequently,
The syntax for removing data is also very similar in local storage and session storage by using removeItem method. It takes a single parameter which is the name of the key-value pair to remove the data. But in a cookie, as you have already seen, to remove cookies you need to set a cookie again but give it a blank value and pass expiration date.