Q:

PHP login system without a database, sessions is not working?

First of all I won't build a login system that uses a database, I know it's more secure but in this case it's not relevant... 
I have three files login.php, admin.php and config.php. The users email and password is stored in variables in config.php. If the user is logging in a session should be set. Then if a user that hasn't logged in trying to access admin.php ":-(" should be printed. But now the ":-(" is always printed and something needs to be wrong with how I coded it all...
config.php:
<?php

//site data

$title = "Abbesplace";
$siteurl = "index.php";

//user data
$password = "testtest";
$email = "example@example.com";
$name = "Albin Larsson";
?>

login.php:
<?php

require_once("config.php");

if (($_POST['email'] == $email && $_POST['password'] == $password)) {
    //login
    session_start();
    $_SESSION['logged']= "welcometomoon";
    header("Location: admin.php");
} else {
    echo "login faild";
}
?>

<!DOCTYPE HTML>
<html>
    <head>
        <title>Login</title>
    </head>
    <body>
        <div>
            <form method="post" action="login.php">
                Email:<input type="email" name="email"/>
                Password:<input type="password" name="password"/>
                <input type="submit"/>
            </form>
        </div>
    </body>
</html>

admin.php:
<?php

if(isset($_SESSION['logged'])){
    echo "Hello";
} else {
    echo ":-(";
}

?>

Any suggestions on what I should make different?
(I'm a newbie when i comes to PHP)...

A:

You have to call session_start on every page. Right now you are only calling it when you post to the login form.

