add session php code example
Example 1: destroy session php
<?php
session_start(); // start session
session_destroy(); // Delete whole session
// OR
unset($_SESSION['username']); // delete any specific session only
?>
Example 2: session start php
<?php
// This sends a persistent cookie that lasts a day.
session_start([
'cookie_lifetime' => 86400,
]);
?>