خرید بک لینک

Vote count: 0

On my webpage, I have a login form that creates a session - but PHP doesn't seem to be acknowledging it:

require_once('globals.php');
require_once('header.php');
if(!isset($_SESSION) || session_id() == '')
{
    $x = (isset($_SESSION));
    var_dump($_SESSION['useame']);
    ?><br><?PHP
    var_dump(session_id());
    ?><br><?PHP
    var_dump($x);
    require_once('system/default.php');     
}
else
{
    require_once('system/' . $SystemScreens[$_SESSION['screen']]);
}
require_once('footer.php'); 

is producing:

NULL
string(0) ""
bool(false)


relavant part of login script (where $finalCheck is a boolean stating if the login was successful)

if($finalCheck)
    {
        session_start();

        $_SESSION['userID']         = $UserID;
        $_SESSION['useame']           = $useame;
        $_SESSION['accessLevel']        = $UserAccess;
        $_SESSION['screen']         = 1;

    }
    else
    {
        if(session_id() != '' || isset($_SESSION))
        {
            if (ini_get("session.use_cookies"))
            {
                $params = session_get_cookie_params();              
                setcookie(session_name(), '', time() - 42000, $params["path"], $params["domain"], $params["secure"], $params["httponly"]);
            }

            session_destroy();
        }

    }


I know that the login function is retuing true because I have visual confirmation (result is retued to an AJAX request, and the page reloaded if true - which it does)

I can't figure out why everything is ruing as if the login is successful, but the session isn't being recognised after the reload occurs?

asked 1 min ago

- - , .
.

برچسب: نویسنده: استخدام کار تاريخ: يکشنبه 27 تير 1395 ساعت: 6:20

صفحه بندی