session_start(); $_SESSION['user_id'] = 1;
session_start(); if(isset($_SESSION['user_id'])) { echo "User ID: " . $_SESSION['user_id']; } else { echo "Session not set"; }Package Library: PHP session is a built-in function in PHP. No external package or library is required to use PHP session.