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

JackD's avatar
Level 6

Session Driver problem

Hi,

Why is that when i use this default

SESSION_DRIVER=file

I'm getting "419 Sorry, your session has expired. Please refresh and try again." error message

But when i changed it to this

SESSION_DRIVER=cookie

It works fine if i use cookie, anyone who know why? I'm using laravel homestead

0 likes
1 reply
ChristophHarms's avatar

The first result when googling "laravel session file 419" is this one: https://stackoverflow.com/questions/52583886/post-request-in-laravel-5-7-error-419-sorry-your-session-has-expired

I think the most likely cause for your problem is the one described in the first answer there, under "Possible error prone scenarios":

Probably file-based sessions might not work because of the permission issues with the /storage directory (a quick googling will fetch you the solution)

Please or to participate in this conversation.