Localstorage

Do URL1 and URL2 belong to the same domain?
This article might be worth reading:

https://jcubic.wordpress.com/2014/06/20/cross-domain-localstorage/