<?php
session_start();
if(isSet($_SESSION['zalogowany'])){
  unset($_SESSION['zalogowany']);
}
else{
  header("Location: index.php");
  exit();
}
if(isset($_COOKIE[session_name()])){
  setcookie(session_name(), '', time() - 360);
}
session_destroy();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Moja strona WWW</title>
</head>
<body>
<p>Wylogowanie prawidłowe</p>
<p><a href='http://localhost/index.php'>Powrót do strony logowania</a></p>
</body>
</html>
