<?php
// Start a new session or resume an existing one
session_start();
// Set session variables
$_SESSION["username"] = "john_doe";
$_SESSION["email"] = "john_doe@example.com";
// Display session variables
echo "Username: " . $_SESSION["username"] . "<br>";
echo "Email: " . $_SESSION["email"] . "<br>";
// End session
session_destroy();
?>
Username: john_doe
Email: john_doe@example.com
session_start()
` function to start a new session or resume an existing one. $_SESSION
` superglobal array. In this case, we set the "username" and "email" variables. echo
` statements to display the values of these session variables. session_destroy()
` function to end the session.