1<?php
2if(isset($_GET['logout'])) {
3 session_destroy();
4 unset($_SESSION['uname']);
5 header('location:login.php');
6}
7?>
1if(isset($_GET['logout'])) {
2 session_destroy();
3 unset($_SESSION['username']);
4 header('location:login.php');
5}
1<?php
2
3ob_start();
4if (!isset($_SESSION))
5 session_start();
6unset($_SESSION['user_id']);
7session_destroy();
8header("location:index.php");
9