Level 1
try sessionStorage.clear(); and call it only when the user log out.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
In my controller, how do i clear the sessionStorage item?
public function logout()
{
Auth::logout();
Session::flush();
return redirect('/login');
}
I stored some data inside session storage and i want to clear it after user logout. But it will only clear if the browser closed.
Please or to participate in this conversation.