<?php
function Login()
{
session_start();
$_SESSION["loggedin"] = true;
echo "You are logged in!";
header("Location: ../L_index.php"); //Aka Logged in Index.
}
function Logout()
{
$_SESSION["loggedin"] = false;
session_destroy();
}
function checklogin()
{
session_start();
if ($_SESSION["loggedin"] == true)
{
return true;
}
else
{
return false;
}
}
?>
This is just a tiny bit of my code, there is security holes, but as you see, there is 3 functions:
Login
Logout
Checklogin
But when i use the Login function, everything is fine, but if i then use the checklogin, then it always returns true(it returns true after i used the logout function), why?