Multiple Passwords for Protected Pages
Login automatic after browser close (7 posts)

  1. tomas2r
    Posted 3 years ago #


    My clients are saying that after they login to the protected page, the login is by-passed upon a re-vist to the site. After the browser is closed and the computer restarted, the login to the protected page is no longer required.


    dSPWsnH9 is one of the logins


  2. graphfx21
    Posted 3 years ago #

    You need to reset the cookie, it is naturally set to 10 days.

    add_action('wp_head', 'setCookiePasswordTime');
    function setCookiePasswordTime()    {
        setcookie('wp-postpass_' . COOKIEHASH, $_POST['post_password'], time() + 10, COOKIEPATH);

    This sets the cookie to expire after 10 seconds, you can set it to whatever you like. Just put this code in your functions.php file.

  3. tomas2r
    Posted 3 years ago #

    Ouch! That zapped the entire site when I updated the .php . I get all pages blank, and can't login via admin. I will have to access the FTP area to edit this out.

  4. webpdq
    Posted 3 years ago #

    I tried the same code in my wp-includes/functions.php and it blew up my site up.
    Fatal error: Call to undefined function add_action() in /home/specialc/public_html/wp-includes/functions.php on line 29

    [ Please do not bump, that's not permitted here. ]

  5. graphfx21
    Posted 3 years ago #

    You have to put this in your theme's functions.php file.

  6. Julio Potier
    Plugin Author

    Posted 2 years ago #


    This is the way WordPress does his thing with post password.

    @graphfx21 : you can't do a set cookie in the header, you have to do it in "template_redirect" for example.

  7. webpdq
    Posted 2 years ago #

    I edited the themes/canvas/functions.php and got this error message
    html/wp-content/themes/canvas/header.php:22) in /home/specialc/public_html/wp-content/themes/canvas/functions.php on line 97

    Could you please tell us exactly which file to add the code to? I do not have a file called template_redirect.


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Multiple Passwords for Protected Pages
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.