While unsetting the session I am getting the error:
Undefined Index
I have used 3 files: set.php unset.php and view.php
I am new to PHP programming. Please Help!
1. set.php:
<?php
session_start();
$_SESSION['username'] = 'ayusch';
?>
2.unset.php
<?php
session_start();
unset($_SESSION['username']);
?>
3. view.php:
<?php
session_start();
echo 'Welcome ' . $_SESSION['username'] . 'you are ' . $_SESSION['age'];
?>
change to this
read this link for unset session