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

extjac's avatar

Laravel Sessions

I have set SESSION_DRIVER=database and I am tracking the user last login date. The issue is that for some reason Apple/Mac users will stay login in the app even if I empty the sessions table. This is an issue because I cant track when the last login was.

any suggestions?

0 likes
8 replies
sr57's avatar

users will stay login in the app even if I empty the sessions table

So you are not using the db session driver.

Have you try to clear the config cache?

1 like
extjac's avatar

@sr57 yes. Tried cache:clear view:clear optimize:Clear etc... and the mac users still login. unfortunately, i don't have a mac to test.

1 like
sr57's avatar

@extjac

Have try config cache clear?

php artisan config:clear

if yes share your config?

extjac's avatar

@sr57 the .env file i have

SESSION_DRIVER=database

and the LoginController.php

use \App\User;
class LoginController extends Controller
{
    function authenticated(Request $request, User $user)
    {

        \Auth::logoutOtherDevices( $request->get('password') );

        $user->update([
            'logged_at' => \Carbon\Carbon::now(),
            'logged_ip' => $request->ip() ,
           // 'logged_country' => $location ?? null,
        ]);

 
    }
}
Snapey's avatar

have you considered that they may have 'remember me' checked

Snapey's avatar

you should also consider that its probably irrelevant that they are on a mac, its about what browser they are using.

extjac's avatar

@Snapey i know.... I actually asked them. All of them are Mac users with safari. Any recommendations on how to kill the ' remember me'?

Snapey's avatar
Snapey
Best Answer
Level 122

@extjac delete the rememberme token in the users table

Please or to participate in this conversation.