Cool-Shopping-Site/logout.php

17 lines
257 B
PHP

<?php
session_start();
unset($_SESSION["uid"]);
unset($_SESSION["name"]);
$BackToMyPage = $_SERVER['HTTP_REFERER'];
if(isset($BackToMyPage)) {
header('Location: '.$BackToMyPage);
} else {
header('Location: index.php'); // default page
}
?>