Auth0 Home Blog Docs

Machine specific issue with Edge browser and Auth0 Lock storage dependency



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?


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, 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).


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: