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

ahmetertem's avatar

Session id changing after payment gateway post response

I'm trying to do payment integration via API (not iframe). After submitting the form to gateway, response has no csrf (obviously), my page is excluded in Middleware/VerifyCsrfToken.php too.

My kernel file

        \App\Http\Middleware\TrustProxies::class,
        \App\Http\Middleware\CheckForMaintenanceMode::class,
        \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
        \App\Http\Middleware\TrimStrings::class,
        \App\Http\Middleware\Currency::class,
        \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,

My response page's middleware are web and auth

After the response, it's sending back me to the login page again.

I've googled it already, but I think I'm missing something. I've started chasing my own tail so here I am.

-- Forgot to mention, Laravel 5.8

Any help appreciated, thank you

0 likes
7 replies
Nakov's avatar

And what do you use a SESSION_DRIVER is it a cookie maybe?

ahmetertem's avatar

@MohamedTammam I'm not using an API. Wrote my own. The provider is PayTR and there is no API for non-iframe version

Please or to participate in this conversation.