# Machine specific issue with Edge browser and Auth0 Lock storage dependency

**URL:** <https://community.auth0.com/t/machine-specific-issue-with-edge-browser-and-auth0-lock-storage-dependency/8359>\
**Category:** Get Help\
**Tags:** storage, edge, lock\
**Created:** [October 2, 2017, 3:37pm UTC](https://community.auth0.com/t/machine-specific-issue-with-edge-browser-and-auth0-lock-storage-dependency/8359 "2017-10-02T15:37:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nolsen](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@nolsen](https://community.auth0.com/u/nolsen)\
**Post date:** [October 2, 2017, 3:37pm UTC](https://community.auth0.com/t/machine-specific-issue-with-edge-browser-and-auth0-lock-storage-dependency/8359/1 "2017-10-02T15:37:38Z")

</div>

In some new Windows 10 machines, the Edge browser throws an exception when JavaScript refers to the `windows.localStorage` object. Identical versions of Edge behave differently so it is properly some other security or setting that causes it.

The storage handler in Lock throws an exception when it tries to determine if it should use `localStorage` or cookie-based storage. As I cannot figure out how to solve the Edge differences, is there a way to configure Lock to always use `sessionStorage` or cookie-based storage?

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [October 2, 2017, 8:11pm UTC](https://community.auth0.com/t/machine-specific-issue-with-edge-browser-and-auth0-lock-storage-dependency/8359/2 "2017-10-02T20:11:08Z")

</div>

To my knowledge there is no configurable switch to always force the use of a specific underlying storage. A quick look at the code it shows some failover mechanism, but none expect that just accessing `localStorage` would throw an error; as a personal opinion it seem a fair assumption.

In relation to the underlying Edge issue you are experiencing, you likely already checked the [following post](https://superuser.com/questions/1080011/localstorage-on-edge-produces-an-internal-error-occurred-in-the-microsoft-inter), but in case you didn’t it does seem to describe your situation given you somewhat hinted at the fact that the issue is specific to `localStorage` and that `sessionStorage` would work fine.

The conclusion on the linked post revolved around issues with the user profile in Windows (I guess `localStorage` will require storing things in the user profile, while `sessionStorage` uses another place).

---

<div class="post-metadata">

**Author:** ![nolsen](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@nolsen](https://community.auth0.com/u/nolsen)\
**Post date:** [October 3, 2017, 6:53pm UTC](https://community.auth0.com/t/machine-specific-issue-with-edge-browser-and-auth0-lock-storage-dependency/8359/3 "2017-10-03T18:53:04Z")

</div>

Thanks for reply. Yes I did check the linked post with no luck. I discovered Edge version 38 works fine but the latest version 40 does not. I now have a working solution by modifying you Lock script and add a check for localStorage that does not throw exception i Edge. The inspiration I got from [this post](https://mathiasbynens.be/notes/localstorage-pattern):  
[https://mathiasbynens.be/notes/localstorage-pattern](https://mathiasbynens.be/notes/localstorage-pattern)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:56am UTC](https://community.auth0.com/t/machine-specific-issue-with-edge-browser-and-auth0-lock-storage-dependency/8359/4 "2018-03-02T05:56:46Z")

</div>


