create a session in php code example
Example 1: 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 2: create session in php
<?php
session_start();
$_SESSION["color"]= "blue";
$_SESSION["animal"]= "dog";
echo "The session variable are set up.";
?>
Example 3: php session variables
<?php
session_start();
$_SESSION['var'];
?>
Example 4: echo session
print_r($_SESSION);
Example 5: $_SESSION php example
<?php
session_start();
echo session_id();
?>