Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save generalistcodes/45d676ee538743a8d238094f032f792b to your computer and use it in GitHub Desktop.
Save generalistcodes/45d676ee538743a8d238094f032f792b to your computer and use it in GitHub Desktop.
Synced via Snip
What happens to localStorage when different browsers are in private browsing mode?
Safari returns null for any item set using localStorage.setItem either before or during the private browsing session.
In essence, neither sessionStorage or localStorage are available in private brosing mode
Chrome and Opera return items set previous to private ("incognito") browsing, but once private browsing commences, treats localStorage like sessionStorage (only items set on the localStorage by that session will be returned) but like localStorage for other private windows and tabs
Firefox, like Chrome will not retrieve items set on locaStorage prior to a private session starting, but in private browsing treats localStorage like sessionStoroage for non private windows and tabs, but like localStorage for other private windows and tabs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment