// Start the session session_start(); // Set a session variable $_SESSION['username'] = 'john123';
// Start the session session_start(); // Get the value of a session variable $username = $_SESSION['username'];These examples use PHP's built-in session handling functions, so no external package library is required.