Lec 17 PHP
Lec 17 PHP
session_start()
Before you can store user information in your
PHP session, you must first start up the
session.
$_SESSION['views']=1;
if(isset($_SESSION['views']))
$_SESSION['views']=$_SESSION['views']+1;
else
$_SESSION['views']=1;
echo "Views=". $_SESSION['views'];
PHP Sessions
unset($_SESSION['views']);
The unset() function is used to free the
specified session variable
session_destroy();
session_destroy() will reset your session and
you will lose all your stored session data.