// Get the current session instance $session = app('session'); // Store user ID in the session $session->put('user_id', $user->id);
// Get the current session instance $session = app('session'); // Retrieve user ID from the session $user_id = $session->get('user_id');
// Get the current session instance $session = app('session'); // Remove user ID from the session $session->forget('user_id');The Illuminate\Http\Request session package is part of the Laravel framework's core libraries. It provides a simple and secure way to manage user sessions in web applications.