phppayment-gatewaycybersource

User session is lost on redirect back from payment gateway


I have configured Cybersource as my payment gateway, I am able to navigate to cybersource and make a payment and able to redirect back to the site successfully. Also i am able to Cancel the payment and redirect back to my website.

Im getting the response from the payment gateway. But, user is getting logged out on redirecting back from the payment gateway.

  1. I'm using https website.
  2. Redirecting back to same URL (https).

Tho im able to re-login the user based on TransactionID. I want to make sure the user session is not lost and the user remain logged in.

Thank you in advance!


Solution

  • The issue is because of your cookie same-site configuration. You should use SameSite=None on your cookies attributes. Also if you use SameSite=None you should set the secure cookies attribute as well.