How to get username from Login system in PHP?

I have a question, when user is logged in, his firstName is not displayed, instead of that the firstName of the last registered user will be displayed. The question is how can I correctly show only the firstName of the person who is logged in with email and password.

I want to use only email and password for login page, but how can I display the firstName after login is my question.

Thx in advance!!

//process.php
`
<?php

session_start();

include_once("config.php");

//*********************************************************************************** */
//account aanmaken process
if(isset($_POST['register'])){
    $conn = config::connect();
    $firstName = $_POST['firstName'];
    $lastName = $_POST['lastName'];
    $email = $_POST['email'];
    $password= $_POST['password'];

    if(insertData($conn, $firstName, $lastName, $email, $password)){
        $_SESSION['firstName'] = $firstName;
        header("Location: profile.php");
    }
}

//account aanmaken function
function insertData($conn, $firstName, $lastName, $email, $password){
    $query = $conn->prepare("
        INSERT INTO users (firstName, lastName, email, password)
        VALUES(:firstName, :lastName, :email, :password)
    ");

    $query->bindParam(":firstName", $firstName);
    $query->bindParam(":lastName", $lastName);
    $query->bindParam(":email", $email);
    $query->bindParam(":password", $password);

    return $query->execute();
}
//************************************************************************************** */



//************************************************************************************** */
//login process

if(isset($_POST['login'])){
    $conn = config::connect();
    $email = $_POST['email'];
    $password= $_POST['password'];

    if(checkLogin($conn, $email, $password)){
        header("Location: profile.php"); 
    }else{
        echo "Email and password are not correct!";
    }

}

//login function
function checkLogin($conn, $email, $password){
    $query = $conn->prepare("
        SELECT * FROM users WHERE email=:email AND password=:password
    ");

    $query->bindParam(":email", $email);
    $query->bindParam(":password", $password);

    $query->execute();
   
    //check the login information
    if($query->rowCount() == 1){
        return true;
    }else{
        return false;
    }
}
//************************************************************************************** */

?>
´



//profile.php
´
<?php

session_start();

include_once("config.php");

echo "Welcome " . $_SESSION['firstName'];

echo "<hr>";
echo "<a href='loguit.php'>Loguit</a><br>";
echo "<a href='update.php'>Edit account</a><br>";
echo "<a href='delete.php'>Delete account</a><br>";

?>

<html>
    <head>
        <link rel="stylesheet" href="style.css">
    </head>
</html>
´