#101. PHP Session
How to Create, View and Delete PHP Session? Create-Session.php <?php session_start() ; $_SESSION [ "favcolor" ] = "orange" ; echo "Session Variable is set." ; ? > View-Session.php <?php session_start() ; print_r($_SESSION) ; ? > <!DOCTYPE html > <html lang = "en" > <head> <meta charset = "UTF-8" > <title></title> </head> <body> <?php if (isset($_SESSION [ "favcolor" ] )){ echo "Favorite Color :" . $_SESSION [ "favcolor" ]; } ? > </body> </html> Delete-Session.php <?php session_start() ; session_unset() ; session_destroy() ; echo "Session is destroy." ; ? >