I Understood that the start_session(); should be included on the page.
Here is the include file:
<?php
if(IsSet($a_username))
$username = $a_username;
if(IsSet($a_password))
$password = $a_password;
$connection = mysql_connect("localhost", "user", "password") or die ("Gick ej att ansluta till server");
$db = mysql_select_db("setdelight", $connection) or die("Couldn't execute query");
$result = mysql_query("SELECT 1 FROM adminusers where username ='$username' and password = '$password'", $connection) or die("Här blev det galet!");
$num_rows = mysql_num_rows($result);
if(!$num_rows)
Header("Location:http://localhost/login1.php");
?>
The strange thing is that when I try to echo $username; on the page, it prints the right username but it still acts like there is no session registered.