exists()) { header('Location: signin'); $_SESSION['message'] = 'Bad password'; exit(); } $_SESSION['login'] = $login; header('Location: admin/welcome'); exit(); } catch(Exception $e) { $_SESSION['message'] = $e->getMessage(); header('Location: signin'); exit(); }