The else dosent work in this code and i have tied lot of things not just redirect()
<html>
<?php if($_SESSION['username']) : ?>
<?
echo "Hi, " .$_SESSION['username']. " | ";
?>
<a href='logout.php'>Logout</a>
<?
else
redirect();
?>
<?php endif; ?>
</html>