function checkLoginStatus()
{
    //Check if session is set...
    if (!isset($_SESSION["soap_session"])) {
        $url = absolute_url('index.php');
        header("Location: {$url}");
    }
    //Check if session is valid
    /*
    $script_wsdl = "http://localhost:8080/sakai-axis/SakaiMobileScriptC.jws?wsdl";
    $active = new SoapClient($script_wsdl, array('exceptions' => 0));
    $response = $active->validSession($_SESSION["soap_session"]);
    */
    $script_wsdl = "http://localhost:8080/sakai-axis/SakaiMobileScriptC.jws?wsdl";
    $soap = new SoapClient($script_wsdl, array('exceptions' => 0));
    $session = $_SESSION["soap_session"];
    //Just need to test if session is open...
    $response = $soap->getUserEmail($session);
    if ($response == "false") {
        $url = absolute_url('index.php?errors=3');
        header("Location: {$url}");
    }
}