Session Authendicator Logout Problem #1079
Replies: 4 comments 4 replies
-
At least, the code should be: public function logout()
{
auth()->user()->revokeAllAccessTokens();
auth()->logout();
} |
Beta Was this translation helpful? Give feedback.
-
Thanks for your answer. But it didn't work. When I call the auth()->user() function without a token, my information is returned again. |
Beta Was this translation helpful? Give feedback.
-
@datamweb @kenjis thanks a lot. I am using session authenticator. But I found something. Authentication > Authenticators > Session.php > logout function, $session = session();
$sessionData = $session->get();
if (!empty($sessionData)) {
foreach (array_keys($sessionData) as $key) {
$session->remove($key);
}
} The code appears to be correct, and the $sessionData variable is populated with the correct values. However, the user sessions are not being deleted, or if they are, they are being regenerated. |
Beta Was this translation helpful? Give feedback.
-
Last version. I know, original condition is isset |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm using Session Authendicator and I am working with Postman.
I am doing these:
My Login Process:
Sending email and password to my api url. Then, I'm getting success message and my Bearer token.
My Logout Process:
I'am sending a request to my Logout URL. (the code is below) It's OK, no problem.
Everything seems OK but I am created a test function for my auth process and sent a api Request to this function.
Normally I need to see the "You logged out!" message. But I'am getting "Yes, Logged In. My user ID is 1"
How that happens? I just logged out.
Sorry for my bad english.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions