how to auto destroy session in php code example Example: clear session php <?php unset($_SESSION['counter']); ?>