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

untymage's avatar

laravel_session cookie VS session drivers

What is different between laravel_session which is in cookie vs the session drivers like 'file' ?

0 likes
3 replies
Snapey's avatar

One thing to bear in mind about cookie sessions is that they can only hold 4k of data which can break feedback on complex forms.

One advantage is that you can have a server farm handle your requests, and it does not matter which server the user hits because their session data comes with the request. If you use file or database for session storage then you have to have a shared location between all servers.

1 like
Snapey's avatar
Snapey
Best Answer
Level 122

thats the authentication cookie that tells the server who you are.

You must always have this, unless using another identification method such as jwt

The session settings say if you want the session data to be stored in session cookie or elsewhere

Please or to participate in this conversation.