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

oabraham's avatar

Which session driver is better

Hey all, Am beginning to build a large application and i was wondering which Laravel Session driver would be better between Database and File based. Am talking in terms of security and as well as speed. I definitely wont want to use Cookies or Array and havent considered Memcache yet.

So what do you advise?

0 likes
6 replies
TaylorOtwell's avatar
Level 5

Either are probably fine for most applications. If you are planning on scaling to multiple servers you will not want to use the file driver.

I personally typically use the "cookie" driver because I don't store much data in session and it requires zero additional storage mechanisms.

4 likes
oabraham's avatar

Thanks Taylor. Would go with the file driver.

tgif's avatar

@Ozan that is ok. Conversations flow differently on the internet. He'll get a notice and if he chooses to respond, I'll get a notice with Laravel's awesome Flash service provider:)

Please or to participate in this conversation.