The password seems to be cached and I want to ensure

The password seems to be cached and I want to ensure the password is required every time the user goes to that content. How do I do that?

  • dgoudy
    • WPMU DEV Initiate

    Thanks for the fast reply. I am not using any cache plugins. Also, I read that Wordpress sets password cookies at 10 days. Anyway, I was hoping to manually set the Password Protect plugin so that each time a visitor vista the page with password protected content, hey would have to enter the password. Or at least know how to set the time the cookie will expire. Does this make sense?
    Thanks,
    Don

  • dgoudy
    • WPMU DEV Initiate

    I am not using any cache plugins. I would like to be able to set the time the password will expire so that the user has to re-enter it in each visit / session. I heard Wordpress sets the default to 10 days. Does this make sense?
    Thanks
    Don

  • DavidM
    • DEV MAN’s Mascot

    Hi Don,

    Thanks for your replies. Currently, the plugin doesn't provide an automated way to set the cookie duration.

    You can set it yourself through the plugin code though.

    Line 89 of \protect-selected-content\protect-selected-content.php reads:

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

    You can alter that 864000 value as needed (it's 10 days, in seconds).

    We'd love to look into adding that as a feature request, seems useful and I recall seeing a past request for it. Perhaps you could post on that here?
    https://premium.wpmudev.org/forums/forum/feature-suggestions

    Cheers,
    David

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.