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

devondahon's avatar

Configuring Database Session Driver

I configured database session this way:

config/session.php:

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

Then I executed:

php artisan session:table
php artisan migrate
php artisan optimize:clear
composer dump-autoload

But when I sign in/out, my session table is always empty.

echo 'SELECT * FROM public.sessions
      ORDER BY id ASC;' | psql mydatabase

Is it something wrong in my configuration ?

0 likes
2 replies
Snapey's avatar
Snapey
Best Answer
Level 122

Did you set SESSION_DRIVER in the .env file and then run php artisan config:clear ?

(or remove SESSION_DRIVER from .env)

Please or to participate in this conversation.