I have a booking application developed using AngularJS that creates user booking details through various pages. This data is stored using SessionStorage (I want to avoid LocalStorage).
When the user goes to the payment page, I generate a PayPal token using a REST call, and then redirect them to PayPal.
The code I use for this redirect is:
window.location.replace("https://www.sandbox.paypal.com/checkoutnow?useraction=commit&token=XXX&ul=0#/checkout/login");
When PayPal sends me back to my confirmation page, the content of SessionStorage has been cleared - but it only seems to be on mobile devices, I cannot replicate it to Chrome on the desktop.
Why is cleaning up SessionStorage cleared?
I understand that since I am not opening a new page (I am simply redirecting), the state must be maintained. The documentation I read says that SessionStorage clears when the window is closed - is that no different from redirecting?
Is there a way to redirect to PayPal while keeping SessionStorage on return?
source
share