Support the ongoing development of Laravel.io →
Authentication Session Configuration

Hello,

I'm working on a projet, i have push my laravel projet on a Git and i'm working with 3 mates. For me, everything's fine, i have a UserController checking if credentials are ok with Auth::attempt and in other part of my code i can call Auth::check().

When my friend pull the content, the project is working, Auth::attempt() works fine, but the Session is not persistent (his /storage/app/sessions if full of files, one file is create at every attempt() call). Every time he call Auth::check(), the function return false.

We have the same files (only vendor/ and .env are ignored by the .gitignore)

My laravel version is 5.4.0

If anyone know how to fix the problem ?

Thank you ;)

Last updated 3 years ago.
0

Sometimes this could happen if you do not set the session config file properly and you have many laravel projects running on the same machine.

Try setting up your Session Cookie Domain under config/session.php

'domain' => '.yoursite.com',  //keep the dot
0

Try switching driver to database in config/session.php

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

Sign in to participate in this thread!

PHPverse

Your banner here too?

Nicolas B nicogo Joined 24 Jun 2017

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.