diff --git a/login.php b/login.php index 51ef051..c55cac2 100644 --- a/login.php +++ b/login.php @@ -23,12 +23,14 @@ } //$2y$10$yJMyDzprPAyf3rBnClqQ3O3poVb5w8gg2KcmZ10DVbTWSzgXeU.Ju //65de59ea345a79fb01174fb34a930d95 + session_start(); include 'db_connection.php'; $conn = openCon(); mysqli_set_charset($conn, "utf8"); $data = json_decode(file_get_contents("php://input"),true); + $email = $data["email"]; //"example@email.email"; $pass = $data["pass"]; //"hasło135$"; @@ -46,8 +48,12 @@ else return false; }; if(isset($answ["salt"]) && checkPassword($pass, $answ["salt"], $answ["hash"])){ + $_SESSION["email"] = $email; echo json_encode(true); } - else echo json_encode(false); + else { + $_SESSION["email"] = null; + echo json_encode(false); + } closeCon($conn); ?> \ No newline at end of file diff --git a/logout.php b/logout.php new file mode 100644 index 0000000..3faad83 --- /dev/null +++ b/logout.php @@ -0,0 +1,27 @@ + \ No newline at end of file diff --git a/start.php b/start.php new file mode 100644 index 0000000..2a48e1d --- /dev/null +++ b/start.php @@ -0,0 +1,28 @@ + \ No newline at end of file