Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

On a browser, sessionStorage in Safari's Private Browsing does not work the same as Chrome's Incognito Mode and Firefox's Private Window?

It seems that for sessionStorage, it works differently on Chrome's Incognito Mode vs Safari's Private Browsing and Firefox's Private Window? I can find something on http://www.webdirections.org/blog/webstorage-persistent-client-side-data-storage/ but it doesn't say that Safari's Private Browsing will throw an exception.

The following is how I opened "Private Browsing":

  1. On Safari on Mac, click "Safari -> Private Browsing" on the menu bar
  2. On Chrome, use "File -> New Incognito Window"
  3. On Firefox, use "File -> New Private Window"

and on Safari, sessionStorage does not work, and if I do the following in the console:

> sessionStorage["foo"] = 123.4 Error: QUOTA_EXCEEDED_ERR: DOM Exception 22  > sessionStorage["foo"]  undefined 

but on Chrome or Firefox, sessionStorage works as usual (as non-private browsing). Is the above accurate as far as sessionStorage is concerned?

like image 395
nonopolarity Avatar asked Sep 17 '13 21:09

nonopolarity


People also ask

Does sessionStorage work in incognito mode?

Local Storage data stored on normal browsing sessions will not be available when you open a browser in private browsing or in Incognito mode.

Is private browsing on Safari the same as incognito?

Answer: A: It is exactly the same as incognito in Chrome. No cookies or data are stored when you use private browsing in Safari.

How do I open private or incognito browsing session in Chrome?

You can also use a keyboard shortcut to open an Incognito window: Windows, Linux, or Chrome OS: Press Ctrl + Shift + n. Mac: Press ⌘ + Shift + n.

Do Chrome VPNs work on incognito?

Do VPNs Work with Incognito? VPNs work with Incognito mode on all browsers. All your traffic is routed around the VPN server when you're connected. The VPN encryption and no-logging policy will give you full privacy even without Incognito mode.


1 Answers

Your assessment is practically accurate:

  • Safari will just use a quota of 0 in private mode, so all attempts to set a value will fail. This is kinda OK according to the spec, as the spec does not mandate a minimum space requirement.
  • Chrome and Firefox still allow you to use storage, however private storage is independent from non-private, i.e. setting an item in private mode will not reflect back into non-private mode (important for localStorage only).

Please note that other browsers are also free to throw QuotaExceededError exceptions at any given time, should you go over the quota.

like image 112
nmaier Avatar answered Sep 19 '22 15:09

nmaier