// Clear session data for a single key Illuminate\Support\Facades\Session::forget('key'); // Clear all session data Illuminate\Support\Facades\Session::flush();
// Delete all data in the session if the user logs out public function logout() { auth()->logout(); Illuminate\Support\Facades\Session::flush(); return redirect()->route('login'); }This code belongs to the `illuminate/session` package library.