Auto refresh of a password protected page

In WordPress, is it possible to auto-refresh a password protected page, such that the password only needs to be entered the first time the page is accessed?

I know how to password protect a page.

I know how to auto refresh a page.

Unfortunately if I auto refresh a password protected page it asks for the password every time the refresh occurs.
Is there a way so that the password only needs to be entered the first time the page is accessed, and not on subsequent refreshes?

EDIT:

Interestingly, if I remove post_password_expires then the auto-refresh works fine without asking for the password each time. However, logout fails (in the sense that the page doesn’t redirect as it should.) If I change it back to the default, or give it any numerical value, then it fails again. (After each of these changes I am clearing my cache and cookies.)

To be clearer, the change I am making is adding the following lines to my theme’s functions.php file as recommended in various other posts such as this one