i wrote this code but it is not working. simply check if some user is already login (with in a browser), if yes then don't show the login page - redirect user to dashboard.
<?php
session_start();
if(isset($_SESSION['usr']))
{
header('location:dashboard.php');
}
error_reporting(0);
?>