<?php
/*
bool session_start ([ array $options = [] ] )
// With session we store information in variables that used across multiple pages
// The variables is not stored on the computer
void session_unset ( void )
bool session_destroy ( void )
*/
session_start();
?>
<!DOCTYPE html>
<html>
<body>
<?php
$_SESSION["user_name"] = "ron";
$_SESSION["country"] = "usa";
echo $_SESSION["user_name"] . " - " . $_SESSION["country"];
// remove all session variables
session_unset();
// destroy the session
session_destroy();
echo $_SESSION["user_name"] . " - " . $_SESSION["country"];
?>
</body>
</html>
<?php
/*
run:
ron - usa
Notice: Undefined index: user_name in C:\xampp\htdocs\workingframe.com\test.php on line 28
Notice: Undefined index: country in C:\xampp\htdocs\workingframe.com\test.php on line 28
-
*/
?>