A few questions came across my mind about how to secure a login page (Web).
When I build a demo app for instance a web-application with VueJS or just really blank u
You could set a session variable for the current user if the login was succesfull. The session is server-side so it is much trickier to hijack the session key.
Further, you could set a time stamp and check when the user's last page refresh took place on each page load. If he did not refresh the page for X amount of time, you can unset the session variable and log out the user.