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

SouravNewaz's avatar

How to disable session for specific route?

Session driver is set to database currently. Now I want to disable session for some route, to speedup the webpage. I am using laravel 7 in my project. What is the best way to disable the session?

I have tried: in StartSession.php file: \Config::set('session.driver', 'array');

Seems like it doesn't work for me, is there any better way?

0 likes
1 reply
Snapey's avatar

This should make next to zero difference to performance.

Please or to participate in this conversation.