WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Upgraded to 3.4 now Password Protected Pages not working (18 posts)

  1. roeshead
    Member
    Posted 2 years ago #

    I just upgraded from 3.3.2 to 3.4 on my site and now the Password Protected pages are not working properly. I get the prompt to input my password but after putting in the correct password (I've repeatedly made sure I had the correct password) and clicking on submit, the screen refreshes like it's going to load the page but only brings up the prompt for the password again. Help? Site was just made live this week.

    Thanks in advance for your help.

  2. candyappledesign
    Member
    Posted 2 years ago #

    I am having the same problem. After entering the correct password for the protected page I'm redirected to the main WP login screen instead of the password protected page.

  3. esmi
    Forum Moderator
    Posted 2 years ago #

    @candyappledesign: It is impolite and contrary to forum policy to interrupt another poster's ongoing thread with a question of your own. Please post your own topic.

    @roeshead: Have you tried:

    - deactivating all plugins to see if this resolves the problem. If this works, re-activate the plugins one by one until you find the problematic plugin(s).

    - switching to the Twenty Eleven theme to rule out any theme-specific problems.

    - resetting the plugins folder by FTP or PhpMyAdmin. Sometimes, an apparently inactive plugin can still cause problems.

    - re-uploading all files & folders - except the wp-content folder - from a fresh download of WordPress.

  4. candyappledesign
    Member
    Posted 2 years ago #

    Deactivating the Better WP Security plugin fixed the problem.

  5. roeshead
    Member
    Posted 2 years ago #

    I switched to Twenty Eleven theme and it worked then I switched back to Supermassive theme by ThemeForest and it works within that browser that I tested Twenty Eleven on but not my other browsers or machines.

    This suggests to me that there's something in the Supermassive theme that is blocking the cookie being created. How is that handled differently now in WordPress 3.4 than WordPress 3.3.2 (where Supermassive worked just fine)? How can I even troubleshoot this?

    This is a live site so I don't have time to wait for Themeforest to "look into it". I'll need to solve this issue on my own quickly.

    Thanks for any insight.

  6. esmi
    Forum Moderator
    Posted 2 years ago #

    I'm sorry but as you are using a commercial theme, you need to seek support from the theme's vendors.

  7. roeshead
    Member
    Posted 2 years ago #

    I can understand your answer - but obviously in the creation of WordPress 3.4, they changed something of how it handles cookie creation for Password Protected pages. Do you have any idea of what might have changed? How would one troubleshoot that process?

    I'm thinking there's going to be more themes than just the one I'm using that is going to have some issues with this but not as many people are going to notice it because of needing the combination of theme issue with using protected pages and actually testing after their upgrade.

    Any pointers of where to look to view this process would be helpful.

    Thank you.

  8. esmi
    Forum Moderator
    Posted 2 years ago #

    There hasn't been any changes to WordPress cookies as far as I am aware.

  9. roeshead
    Member
    Posted 2 years ago #

    Well, the maker of the theme was much more responsive than I thought he would be (I know the people here are always responsive so thank you for that). Turns out that the theme was using a custom password form. Once I removed the code to use that, it worked just fine.

    If you don't know if your theme uses a custom password form (like I didn't realize mine did), looking in the theme's functions.php file for something like:

    add_filter('the_password_form', 'custom_password_form');

    Thanks esmi for your help.

  10. esmi
    Forum Moderator
    Posted 2 years ago #

    No problem. Glad you got it sorted. :-)

  11. gsibert
    Member
    Posted 2 years ago #

    @roeshead, WP 3.4 doesn't use wp-pass.php anymore.

    If you look at the code under add_filter('the_password_form', 'custom_password_form') that calls your custom form function, look for /wp-pass.php and replace it with /wp-login.php?action=postpass

    That should fix it up, at least that's what I used to fix custom password forms.

  12. gsibert
    Member
    Posted 2 years ago #

    I expanded on this a bit here for anyone looking for a bit more detail:

    http://tummel.me/wordpress-3-4-custom-password-form/

  13. spisana
    Member
    Posted 2 years ago #

    @gsibert FANTASTIC!

    I've been crawling the web looking for hints on how to fix it, and I am glad I came across your solution - thanks!

  14. Ashton.Sanders
    Member
    Posted 2 years ago #

    Thanks @gsibert!

  15. Teri
    Member
    Posted 2 years ago #

    https admin vs http site issue:
    I spent a lot of time looking for a problem with our theme, but our issue turned out to be something entirely different. Maybe this post will help someone else.

    If your setup runs SSL on the admin portion of your site, but the public-facing site is not secured, the password cookie isn't being recognized. If you put the "s" in "http" on the page with the password and it works, you can solve this issue by rewriting the password form in your theme's functions.php file like this:

    add_filter( 'the_password_form', 'custom_password_form' );
    function custom_password_form() {
    	$url = get_option('siteurl');
    	$url = preg_replace("/^http:/", "https:", $url);
    	global $post; $label = 'pwbox-'.( empty( $post->ID ) ? rand() : $post->ID ); $o = '<form class="protected-post-form" action="' . $url . '/wp-login.php?action=postpass" method="post">
    ' . __( "<h2>Enter password</h2>
    <p>This content is password protected. To view it please enter the password below:</p>" ) . '
    <label for="' . $label . '">' . __( "Password:" ) . ' </label><input name="post_password" id="' . $label . '" type="password" size="20" /><input type="submit" class="submit" name="Submit" value="' . esc_attr__( "Submit" ) . '" /> </form>
    ';
    return $o;
    }
  16. David Gard
    Member
    Posted 1 year ago #

    The issue of custom password forms not working post update to 3.4 is because the action has been changed on the default WP form.

    Where as it was -

    get_blotinfo('site_url').'/postpass.php'

    It is now -

    get_blotinfo('site_url').'/wp-login.php?action=postpass'

    Update your custom form and you shoule be good to go.

  17. wizard247
    Member
    Posted 1 year ago #

    Hi,

    I've got the same issue, however, I don't think my theme (Theme-Dutch MikMag) is using a customised password form. I've searched all through the theme and cannot find it. There is also nothing in the functions.php.

    My page: http://voxharmony.org.au/wp/2010-repertoire/

    is password-protected and when I click on submit (with or without the correct password) - it doesn't even load the call but produces a blank page instead with one fullstop. The URL called is:

    http://voxharmony.org.au/wp/wp-login.php?action=postpass

    which seems correct - so why doesn't it pass a result?

    I've reinstalled WordPress 3.5.1 but no success.

    Does anyone have any other ideas?

    Thanks,
    Wizard247

    P.S. Sorry - I have now opened a new thread since this one is marked as "resolved".

  18. wizard247
    Member
    Posted 1 year ago #

    Just in case anyone comes here. Today my issue was fixed through hosting provider solution:

    "We have again gone through your issue and found that there was an issue with "ModSecurity: Access denied", now we have corrected your issue."

    After this, password-protected pages worked fine again. My advice, check with your provider and don't get fobbed off.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.