<?php
session_start();
echo $_SESSION['usr']; //just to check
if(isset($_SESSION['usr']))
{
header('location:dashboard.php');
}
else
{
header('location:login.php');
}
?>
check correctly that $_SESSION['usr'] is right. Is it usr or username like that? The above code is correct. If it is still not working, it means that there was an error while setting that session ur. recheck the code, to after login form. Try echo $_SESSION['usr']. so that it will make things more clear