• I can’t quite figure out what’s happening with the built-in password protection on a single page. When I activate it, it works fine. But then every time I visit that page, I’m granted access without having to re-enter my password. That’s fine, but when does that page get re-protected? I’ve restarted my browser and I’m still granted access. I’ve cleared my cache and cookies and I’m still granted access. When does that get re-set so the user would have to re-enter the password?

    What are the parameters for password-protected access? I can’t figure this out! Thanks…

Viewing 15 replies - 16 through 30 (of 31 total)
  • Sheila

    (@hoffmangraphics)

    Try the plugin I recommended above. It’s free and easy and safer than the built in password protection which leaves you logged in (not good if on a public computer).

    Thank you Sheila, buy i can′t find the menu PLUGIN.

    i followed the installation steps (I think this is just for WP.org but I have WP.com)
    Upload plugin-name.php to the /wp-content/plugins/ directory
    Activate the plugin through the ‘Plugins’ menu in WordPress
    Configuration is found under ‘Settings’ ‘Better Protected Pages’ in the WordPress admin menu
    any idea?

    Sheila

    (@hoffmangraphics)

    Sorry…never used WP.com so I don’t know what your limitations are and what’s possible. Perhaps someone else can assist.

    I’m having the same problem—I can log in to my password protected page, once, but then it stays open forever. I’ve tried all the suggestions above, except for the plug in.

    I re-edited the page, logged out, cleared caches, changed the cookie storage time, the whole nine yards.

    What to do?

    Sheila

    (@hoffmangraphics)

    The plugin I recommended works great although it does depend on your user following through and clicking the log out button. But AFAIK WP itself has no real way to address this issue.

    Thanks Sheila!

    Just tried the plugin and it’s not working. It put the “lock this page” button on the page, and when I press the button the entire page goes blank, but when I go back to the home page and then navigate to the page that’s supposed to be password protected, it’s still open—with the lock this page button showing.

    I’ve after testing with the password the first time I’ve never been able to “re-lock” the page. Any other suggestions are most welcome.

    Try putting this in your theme’s functions.php:

    add_action( 'wp', 'post_pw_sess_expire' );
        function post_pw_sess_expire() {
        if ( isset( $_COOKIE['wp-postpass_' . COOKIEHASH] ) )
        // Setting a time of 0 in setcookie() forces the cookie to expire with the session
        setcookie('wp-postpass_' . COOKIEHASH, '', 0, COOKIEPATH);
    }

    Thanks Mickey!

    That worked perfectly! You’re my hero.

    Now that password protection is working, I have another query.
    When the page is password protected it automatically generates the following text:

    “This post is password protected. To view it please enter your password below:”

    Anyone know what I need to do to change that text?
    Thanks a million!

    Just wanted to send my thanks to MickeyRoush as I’ve used the code and it works perfectly ??

    The same as what TAC28 said. Thanks, MickeyRoush!

    Hi There,

    I have several pages that are password protected. Is it possible to use a variation of this code that will allow all pages that are password protected to remain unlocked until the end of the session?

    i.e. if you have entered the password once on any one of the protected pages you can view all of them without re-entering it. Then if you navigate away from the site and you go back in, you have to then re-enter the password.

    I found that the code from MickeyRoush worked as long as I didn’t use the BACK button to navigate back to the page, although in Safari it worked then too. Is that because using the BACK button causes the cached page to display, whereas typing the address into the address bar re-loads the page?

    I should have added: Is there any clever way to get around this? Is there a way to force a password even when the user uses the BACK button to return to the page?

Viewing 15 replies - 16 through 30 (of 31 total)
  • The topic ‘Password protecting pages — how does it work??’ is closed to new replies.