Problem/Motivation

Drupal 8 using localStorage to store UI options. But ALL IEs denied localStorage access in Local Network (eg. localhost, 192.168.x.x). Therefore, some backend UI (eg. Block, toolbal) are broken.

Further tests:
@see #8

Same issue:
http://stackoverflow.com/questions/13102116/access-denied-for-localstora...
http://stackoverflow.com/questions/15031686/localstorage-on-ie8-ie9-with...
(Google "IE localstorage localhost", check out top 10 pages)

Proposed resolution

Add fallback solution

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

droplet’s picture

Component: Seven theme » javascript
nod_’s picture

there's been a couple benchmaks with cookies against localStorage, localStorage was better. It's good as long as we don't start storing images or several hundred BK of data in there. Right now it's for true/false and short strings values.

If IE10 fuck us up with localStorage we have to go with session storage, which isn't a big deal for toolbar, the show row weight value. If that doesn't work either I'll just give up on the whole thing and start the IE ranting.

For now let's try to get to the bottom of the issue first.

I don't have a Win8 to test on :(

das-peter’s picture

Status: Active » Postponed (maintainer needs more info)

I've just tested this.
System: Win8 64x, IE10 with default (recommended) security settings.
Server: localhost (http://d8.localhost)

Besides the fact that I can't find the code mentioned in the stackoverflow.com issue: if(window.localStorage.getItem('phone') == null)
Everything seems to work as expected, no error reports.
If I'm not wrong the toolbar uses to localStorage too (e.g. localStorage.getItem('Drupal.toolbar.activeTab')).
And restoring the active tab after closing and re-opening the browser is working.

droplet’s picture

Status: Postponed (maintainer needs more info) » Active
FileSize
43.43 KB

I bet when you browser "http://d8.localhost", it popup a message to ask you to run it as local intranet (low security level). That's why it worked. Also work with run as admin. (just tested)

It's my default settings (reset all IE settings, and I'm not a daily IE user, so not touch it at all. same to all other Win8 users ?)
11-26-2012 3-00-17 AM.png

When "Enable Protected Mode" is selected, it's failed.

AFAIK, other browsers can disable localStorage, add a backup solution to drupal is good for every case.

nod_’s picture

did you by any chance selected "no" and "never show this message again" when a website first tried to used localStorage?

droplet’s picture

my tests shows:
- If protected mode off, it's okay
- If run as admin, it's okay

I think W8 enabled protected mode & run as non-admin permission by default. It's the problem.

nod_’s picture

how about sessionstorage, is that working at all?

droplet’s picture

Run IE10 with "desktop" mode
sessionstorage: OK
localStorage: FAILED

Run IE10 with "run as admin"
sessionstorage: OK
localStorage: OK

Run IE10 with "InPrivate" mode:
sessionstorage: OK
localStorage: OK

Run IE10 with "protected mode" off
sessionstorage: OK
localStorage: OK

Run IE10 with Metro mode
sessionstorage: OK

localStorage:
http://example.com OK (broswing this site directly: test site)
http://192.168.56.2/localstorage_test.htm FAILED (test source file (added 10 counts each time, IE bug ?)
http://192.168.56.2/drupal8x FAILED
http://192.168.56.108/drupal8x/localstorage_test.htm FAILED (added 10 counts each time, IE bug ?)

Windows 8 has 2 mode: Desktop & Metro.
Desktop opens the app normally
Metro opens in full screen

Test Env: Windows 8 64 bits & IE10. Restore IE10 settings before tests.

nod_’s picture

Thanks a lot for the extensive testing. I'll look into it. Not bound by feature freeze so it might get pushed to next week if nobody is up for it :) But it is strange that I haven't heard about that before.

That default config is a big fail. Anyway I'll pass on the IE bashing for now.

droplet’s picture

EDITed #8, added funny case.

nod_’s picture

das-peter tested with a proper domain, can you edit your host file to have something like http://d8.localhost/ and try again?

From what I read they disable it to avoid leaking data to other things, after all on your localhost anything under the ip has access to localstorage, cookies and all.

droplet’s picture

FileSize
69.18 KB

Nope.

das-peter, can you reset IE settings and test again ?

11-26-2012 9-32-59 AM.png

das-peter’s picture

I don't think I can reset settings, that was just the second time I opened IE on a machine which I just got. The first time I used it to download chrome, the second time was the test from above and this time I confirmed that I want to use the recommended security settings - on the first run I simply skipped this step as I don't intend to use IE...
From my point of view my settings are as untouched as it can get - as far as the Lenovo pre-installed Win8 hasn't a modified IE version.
I'm running the stuff in Desktop mode, my user-account has administrative privileges but I didn't run IE with the command "Run as administrator".

das-peter’s picture

I've just created another, non administrative, user on my machine and logged in with it.
Same behaviour, on first IE startup I confirmed that I'll use the recommended compatibility and security settings.
After that I accessed the drupal installation, logged in as admin and browsed around. Active tab was set properly and I didn't get any error alerts or messages in the console.

jessebeach’s picture

jessebeach’s picture

Issue tags: +toolbar-followup

added toolbar-followup tag

nod_’s picture

Still happening?

droplet’s picture

Title: "Access Denied" for localstorage in IE10. » "Access Denied" for localstorage in ALL IEs
droplet’s picture

Issue summary: View changes

update

nod_’s picture

IE10 Win8 64x

Reseted my settings as in #12, no errors shows up for http://drupal8/ or http://192.168.1.42/ (the drupal8 host points to the same IP).

droplet’s picture

@nod_,

Make sure you haven't turn on Intranet setting. ( Sometimes IE won't hint you to turn on )

Anyway, What will we do if it really exist ?? Don't want to waste anymore time on this topic.

shellbufton’s picture

Hi guys, not sure if this is relevant or not but I came across this while looking for a solution to the same problem. Anyway, according to this it seems to be a corrupt user profile in IE and not related to the site itself?

See final comment here:
http://answers.microsoft.com/en-us/ie/forum/ie10-windows_7/ie10-script5-...

Hope this helps.

droplet’s picture

most of time we could not ask commercial users to change their IE settings :)

droplet’s picture

Issue summary: View changes

update issue

nod_’s picture

Issue summary: View changes

2 years, any change in that issue?

nod_’s picture

Status: Active » Postponed (maintainer needs more info)

Droplet is maintainer now :D

Fallback solution, what you have in mind?

droplet’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

hmm. I can't reproduce it myself anymore.
http://dev.modern.ie/tools/vms/

PS: for anybody may hit this errors, you can add your domains into trust zone.