laravel / ideas

Issues board used for Laravel internals discussions.
938 stars 28 forks source link

Logout session flushing inconsistency in AuthenticateSession middleware and SessionGuard #2451

Open mohsenyz opened 3 years ago

mohsenyz commented 3 years ago

Logging out, means closing the current session (flushing the session)

AuthenticateSession middleware flushes the session in order to logout the user (see here https://github.com/laravel/framework/blob/28e0f61bba1cbc727383d183b7116eb723de7660/src/Illuminate/Session/Middleware/AuthenticateSession.php#L94)

While Laravel Auth::logout() removes only guard-related authentication key from the session (here : https://github.com/laravel/framework/blob/c007d7cc726c5bf839d3547a5f021f927635ee73/src/Illuminate/Auth/SessionGuard.php#L555)

These same operations have been implemented in different ways, making the framework inconsistent at session handling I was wondering if there is any plan to fix this (Or if it's considered as an issue)

mohsenyz commented 3 years ago

@taylorotwell , @nunomaduro , @themsaid , @JeffreyWay, @jbrooksuk, @mattstauffer, @GrahamCampbell