- if (window.location.href.indexOf(REDIRECT_TO_KEY) > -1) {
- const { location: { href }, sessionStorage } = window;
- const redirectUrl = href.split(`${REDIRECT_TO_KEY}=`)[1];
-
- if (sessionStorage) {
- sessionStorage.setItem(REDIRECT_TO_KEY, redirectUrl);
- }
+ let redirectUrl;
+ const { location: { href }, localStorage } = window;
+
+ if (href.indexOf(REDIRECT_TO_KEY) > -1) {
+ redirectUrl = href.split(`${REDIRECT_TO_KEY}=`)[1];
+ }
+
+ if (localStorage && redirectUrl) {
+ localStorage.setItem(REDIRECT_TO_KEY, redirectUrl);