Password Protect plugin - when does the password expire?

I am using Password Protect (successfully) on a site to protect a members only section. I have 2 questions:
1. Once you successfully enter the password how long does it take before it expires and you have to enter it again? For example, I can close out my browser. Come back 30 minutes later and still access the section without a prompt to re-enter the password.
2. Is there a place where I can control this so that if you are inactive for 10-15 minutes or leave the site, that you have to re-enter the password in order to access the content?

  • Vaughan

    Hi @spark4,

    It says on the usage page:

    On the front end, entering the password works the same as post passwords, it’s stored in an encrypted cookie for 10 days.

    If you wish to shorten this, you will need to edit the plugin code directly.

    Open protect-selected-content.php

    Find the following on line 93

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

    Change the time 864000 (this is the amount of seconds)

    So if you want only 15 mins. Change the value 864000 to 900.

    Remember, you will need to add this change again if you ever update the plugin (Though this plugin doesn't have many updates)

    Hope this helps

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.