I recently had a client that wanted to prevent a password protected page from being accessible after they closed the browser from a public location. By default, a password protected page will be accessible for 10 days via a cookie. By adding this plugin to your site it will expire the login session for the password protected page once the browser is closed or page is refreshed. While you can do this via the function.php file within your theme I wanted to make it a plugin so when you update your theme files you don’t overwrite the code.
You can download the plugin from WordPress or GitHub.
If the information I provided helped you. Feel free to buy me a cup of coffee. Tips are always appreciated.