This is my LOGIN.php:
require_once 'include/DB_Functions.php';
$db = new DB_Functions();
// json response array
$response = array("error" => FALSE);
if (isset($_POST['email']) && isset($_POST['password'])) {
// receiving the post params
$email = $_POST['email'];
$password = $_POST['password'];
// get the user by email and password
$user = $db->getUserByEmailAndPassword($email, $password);
if ($user != false) {
// use is found
$response["error"] = FALSE;
$response["uid"] = $user["unique_id"];
$response["user"]["name"] = $user["name"];
$response["user"]["cognome"] = $user["cognome"];
$response["user"]["email"] = $user["email"];
$response["user"]["email2"] = $user["email2"];
$response["user"]["numero_appartamento"] = $user["numero_appartamento"];
$response["user"]["nome_edificio"] = $user["nome_edificio"];
$response["user"]["zona_metropolitana"] = $user["zona_metropolitana"];
$response["user"]["created_at"] = $user["created_at"];
$response["user"]["updated_at"] = $user["updated_at"];
header('Content-type: application/json');
echo json_encode($response);
} else {
// user is not found with the credentials
$response["error"] = TRUE;
$response["error_msg"] = "Login credentials are wrong. Please try again!";
echo json_encode($response);
}
} else {
// required post params is missing
$response["error"] = TRUE;
$response["error_msg"] = "Required parameters email or password is missing!";
echo json_encode($response);
}
How can i insert a timeout of 30 minutes?
THANKS IN ADVANCE EVERYBODY!