Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Hassankhan's avatar

Payment gate ReturnBackUrl

I integrate the payment gate i am facing problem when return back url call it destroy my app session in Laravel and show 419 expire page

0 likes
1 reply
LaryAI's avatar
Level 58

The issue of the session being destroyed and the 419 error page being displayed could be due to a CSRF token mismatch.

To solve this issue, you can try disabling CSRF protection for the return back URL by adding it to the $except array in the VerifyCsrfToken middleware.

Here's an example of how to do this:

  1. Open the app/Http/Middleware/VerifyCsrfToken.php file.
  2. Add the return back URL to the $except array. For example, if your return back URL is https://example.com/payment/return, you would add the following line to the $except array:
protected $except = [
    'payment/return',
];
  1. Save the file and test your payment integration again.

Note: Disabling CSRF protection for the return back URL may pose a security risk, so make sure to thoroughly test your payment integration and implement other security measures as necessary.

Please or to participate in this conversation.