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

yap's avatar
Level 2

How do I disable remember me feature in Laravel authentication

I tried to disable remember using Auth::attempt($credential, false) and my authentication table does not have the remember_token column, but it's not working because when I do Auth::logout, this is what I got Illuminate \ Database \ QueryException (42S22) SQLSTATE[42S22]: Column not found: 1054 Unknown column 'remember_token' in 'field list' (SQL: update `users` set `remember_token` = kdVSd99TgUd9lCGXFp8igsoCWvpMiXln1hnzOFO0bTa3h2HfpSD1AHyDbvN3 where `id` = 5C0093D02AF58)

0 likes
1 reply
tpane24's avatar

You are getting this error since you deleted your remember_token column. When you login with

Auth::attempt($credential, false)

A remember token isn't saved. So the remember functionality should be disabled with the above line. However, the issue you are having is when you call Auth::logout(). It will attempt to replace the remember_token once you have logged out, but that column no longer exists. Replace the column in your database it should be working. You can test that the remember_token is NOT working by attempting to log in with the following:

if (Auth::viaRemember()) {
    session()->flash('status', 'The user was authenticated using remeber token');
} else {
    session()->flash('status', 'The user was NOT authenticated using remeber token');
}

Please or to participate in this conversation.