Jump to content

migi0027

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Posts posted by migi0027

  1. <?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?

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.