将用户标识存储到会话中

I currently have a login.html and processlogin.php. I want to store the userid from login.html into processlogin.php by using sessions. After that, i would wish to display welcome "userid" in my index.html. I want to know whether it is possible to do it and how should i do it. Currently, processlogin.php is using the post method to retrieve data from login.html and checks with the database whether the user is in the database.

Login.html

        User id: <input type ="text" name = "userid" required>
        Password: <input type = "password" name = "password" required> 

processlogin.php

<?php
$mysqli = new mysqli("localhost", "root", null, "shoes");
$stmt = $mysqli->prepare("SELECT password FROM user WHERE userid=?");
$stmt->bind_param("s", $userid);
$stmt->execute();
$stmt->bind_result($p);
$stmt->fetch();
if($p == $password)
{
    echo header('Location: index.html');
}
else
{
    echo '<p><h1>Login unsuccessful!</h1>';
    echo "Please <a href='login.html'>Click Here</a> to go back to login.";
}
$stmt->close();
$mysqli->close();
?>

We can't print use any PHP variables in HTML page.

To Get UserId In Login Page, we need to convert login.html in to login.php or Redirect to index.php after successfully login. Save user id in php session Variable. Example:- $_SESSION['user_id'] = $userId;