// Start the session session_start(); // Set the user's name as an attribute $_SESSION['name'] = 'John'; // Retrieve the user's name from the session echo "Hello " . $_SESSION['name']; // Set the user's preferences as an attribute $_SESSION['preferences'] = array('color' => 'blue', 'font-size' => '16px'); // Retrieve the user's preferences from the session echo "Your preferred color is " . $_SESSION['preferences']['color'];The setAttribute method is available in the PHP standard library, which is included in all PHP installations.