Home Tutorial Php Examples session_unset()

 
 

session_unset()
Posted on: July 31, 2009 at 12:00 AM
Advertisement
In this example you will learn about session_unset() in PHP.

session_unset()

session_unset function is used for removing all variables in a session. For unsetting the session, it must be opened. Let's see in the example.

<?php

session_start();

$_SESSION["email"] = "raj@rediffmail.com";
echo "Your Email is ".$_SESSION['email'].".<br />";
#session delete
unset($_SESSION["email"]);
echo "After Session variable delete <br>";
#check Session variable after unset session
echo "Your Email Id is: ".$_SESSION["email"].".";
?>

Advertisement

Related Tags for session_unset():


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: July 31, 2009

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com