Support » Fixing WordPress » Password protected page still shows even after cookie expired

  • Hello,

    I have setup a password protected page using the WP page editor. When you click on the page, it asks for the password, I enter it and the page shows up. However, if I leave the protected page then hit the “back button”, all the content is still in the cache and shows up. This is true even after I tried setting the cookie timeout to zero.

    Could I use a javascript to clear the cache after a set period of time?

    Thanks for any help!

Viewing 1 replies (of 1 total)
  • Same issue here and I was able to locate and apply a “fix”,

    Find your wp-pass.php file in the WordPress root install folder. Download and save a copy. Then edit it and look for the following line of code:

    setcookie('wp-postpass_' . COOKIEHASH, $_POST['post_password'], time() + 864000, COOKIEPATH);

    Change the 10 day cookie timeout of “864000” (number of seconds) to something like “60”.

    Upload and overwrite the existing wp-pass.php file (again make sure you have a backup of the original just in case).

    Reset the passwords on your protected pages to clear any existing cookies and the new timeout should be in effect.

    Also if interested in customizing the Protected page prompt check out this nice post:

Viewing 1 replies (of 1 total)
  • The topic ‘Password protected page still shows even after cookie expired’ is closed to new replies.