The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Password protect page remembers (6 posts)

  1. Dave Redfern
    Posted 6 years ago #


    I am using password protection of some pages but it seems to set a cookie once the password is entered to remember to login. Is there a way logout or stop wordpress creating this plugin so you have to log in each time?



  2. fruitybeetle
    Posted 6 years ago #


    I'm looking for the same thing - I don't mind users only logging in once to a protected page all the time the browser is open, but if the browser is closed, I want them to have to log in again the next time they visit the page. Any ideas?


  3. overhaulmedia
    Posted 6 years ago #

    I am looking for the same thing! Any word?

  4. kwyjibo_AT
    Posted 6 years ago #

    Hi there!

    Check out wp-pass.php in your wordpress directory.
    You'll find a line like this:
    setcookie('wp-postpass_' . COOKIEHASH, $_POST['post_password'], time() + 2, COOKIEPATH);
    The value after the "+" indicates the time in seconds, the cookie stays valid. In this example it is valid for 2 seconds, setting it to 7200 would be equivalent to 2 hours.

    This solution works for me.
    You may find further information on:



  5. phuile
    Posted 6 years ago #

    I tried this, but it didn't work :(
    I have tried deleting files and cookies. But when I got back into the website and click on the page, it is already logged in. What else have I got to do to make this work?

  6. nickolia
    Posted 6 years ago #

    This worked perfectly for me. Just make sure you go into your cookies and delete the current wp-postpass_... cookie that is there as it will not overwrite it, but has to be deleted before the new 2 sec cookie takes it's place.

Topic Closed

This topic has been closed to new replies.

About this Topic