简体   繁体   中英

Session lost after JS redirect

I integrated PayPal Button in my website.

When an user select pay with PayPal Button, a PayPal login screen appears. The user login into, select your card, shipping address and click in "continue".

After that, PayPal redirects (using JS) to my callback URL:

https://foo.com/paypalbutton/callback

In some cases, after redirect, the session is changed. So my PHP script, that handle /paypalbutton/redirect, cant read the cart_id stored in the session.

Any ideas ?

Hard to say for sure but my guesses are below I've had a similar problem when a url was http://example.org but a webhook redirected to http:// www .example.com. www .example.org is not the same as example.org

Make sore your url is the same before and after the redirect. If it was https - make sure it remains https, If it had www prefix - make sure it will still have www prefix after redirect If it had subdomain prefix - keep that as well.

If nothing else helps - save session is database

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM