php unset session variable and end session code example
Example 1: php unset session variable
// Destroy a sesion variable name 'variable_name'
<?php
unset($_SESSION['variable_name']);
?>
Example 2: end session variable php
// destroy the session
<?php
session_destroy();
?>
Example 3: clear session php
<?php
unset($_SESSION['counter']);
?>