set session code example
Example 1: destroy session php
<?php
session_start();
session_destroy();
unset($_SESSION['username']);
?>
Example 2: set php varibianle session
<?php
session_start();
?>
<!DOCTYPE html>
<html>
<body>
<?php
$_SESSION["color"]= "blue";
$_SESSION["animal"]= "dog";
echo "The session variable are set up.";
?>
</body>
</html>
Example 3: create session in php
<?php
session_start();
$_SESSION["color"]= "blue";
$_SESSION["animal"]= "dog";
echo "The session variable are set up.";
?>
Example 4: php session variables
<?php
session_start();
$_SESSION['var'];
?>