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

Viking's avatar

[L5] Session to DB

hello guy's

i'm trying to save my sessions in MySQL instead in my sessions folder but no luck.

What i did until now: ( clean laravel install )

  • php artisan session:table
  • composer dump-autoload
  • php artisan migrate

config/session.php

  • 'driver' => env('SESSION_DRIVER', 'database'),

Did i forgot something? because after these changes it still save the sessions inside my sessions folder and nog in my DB.

Greets

Viking

0 likes
3 replies
JeroenVanOort's avatar
Level 6

Are you sure the SESSION_DRIVER entry in .env is set to what you want?

1 like
JeroenVanOort's avatar

You're welcome, niets te danken.

On this forum, you can mark replies as the answer to your question as to make clear you've had a satisfying answer.

Please or to participate in this conversation.