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?
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?
@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.
@extjac
Have try config cache clear?
php artisan config:clear
if yes share your config?
@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,
]);
}
}
have you considered that they may have 'remember me' checked
you should also consider that its probably irrelevant that they are on a mac, its about what browser they are using.
@Snapey i know.... I actually asked them. All of them are Mac users with safari.
Any recommendations on how to kill the ' remember me'?
@extjac delete the rememberme token in the users table
Please sign in or create an account to participate in this conversation.