• Simple to setup, and it just worked.

    Would be great to have a single plugin that allowed you to customize and style the login and logout for password protected pages (including button text), control the session expiration (see function below), and allow a global password for multiple protected pages. That would be a nicely rounded solution.

    This plugin is good to use in combination with the following function, which allows you to expire the session cookie:

    [ Moderator note: code fixed. Please wrap code in the backtick character or use the code button. ]

    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);
    }
  • The topic ‘Works Nicely – Some Suggestions’ is closed to new replies.