You must store the information that user is logged into the session :
if($input_password == $set_password) {
$_SESSION['logged_in'] = true;
header("Location: home.php");
die();
}
Then, in any page that requires users to be logged in (home.php), you check $_SESSION['logged_in']
:
if(!isset($_SESSION['logged_in']) || $_SESSION['logged_in'] !== true)
header("Location: index.php");
Also do not forget to add session_start();
in your login.php and home.php pages (and any other pages that requires authentication)