Try Javascript Local Storage
<!DOCTYPE html>
<html>
<body>
<h1>The Window Object</h1>
<h2>The localStorage Property</h2>
<p>Saved name is:</p>
<p id="demo"></p>
<script>
// Set Item
localStorage.setItem("lastname", "Smith");
// Retrieve
document.getElementById("demo").innerHTML =
localStorage.getItem("lastname");
</script>
</body>
</html>
Note: The localStorage object stores data with no expiration date.
The data is not deleted when the browser is closed and are available for future sessions.
If you delete cookie in your web browser manually, all local storage data will delete too.
Unlike Cookie, localStorage cannot be access from PHP Code script. This is not recommended if you need login credential that needs verification from server side.