Session Storage lost on window.location.replace
<p>I have a booking application developed using AngularJS that is building up details of the users booking through various pages. These details are stored using SessionStorage (I want to avoid LocalStorage).</p>

<p>When the user gets to the payment page, I generate a PayPal token using a REST call and then redirect them to PayPal.</p>

<p>The code I'm using for this re-direct is:</p>

<pre><code>window.location.replace("https://www.sandbox.paypal.com/checkoutnow?useraction=commit&amp;token=XXX&amp;ul=0#/checkout/login");
</code></pre>

<p>When PayPal sends me back to my confirmation page the contents of SessionStorage have been cleared - but this only seems to happen on mobile devices, I can't replicate it with Chrome on desktop.</p>

<p><strong>Why does the SessionStorage get cleared?</strong> </p>

<p>My understanding is that because I'm not opening a new page (I'm just re-directing) the state should be persisted. Documentation I have read says that SessionStorage is cleared when the window is shut - does this not differ from a redirect?</p>

<p><strong>Is there a way to redirect to PayPal whilst persisting SessionStorage on return?</strong></p>