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

alioygur's avatar

L5 how can i remove session and cookie completely for restful api

L5 how can i remove session and cookie completely for restful api ?

0 likes
7 replies
bashy's avatar

You can easily create a cookieless domain by using a CNAME for it.

alioygur's avatar

bashy, i don't understand you.

i want disable cookie and session. from laravel.

rikh's avatar

Take a look in Kernel.php and remove all the middleware relating to sessions and cookies from there.

You'll also need to look in your config (session.php) and change the driver to array

That should be about it - though I may have missed something.

bashy's avatar

Ah thought you wanted to have a cookieless domain :)

jgreen's avatar

what if I want to remove cookies from PART of my application?

Please or to participate in this conversation.