I try to make redirection after successful login.
In php if password and user match, then $_SESSION['loggedin'] = 1;
$ifloggedin = $_SESSION['loggedin'];

In ajax would need something like this

if($ifloggedin == 1) {
window.location = "login-success.php";
}

but seems something wrong.

Could someone explain or give link where I can read about the question?