Forums

Password protect page remembers (4 posts)

  1. daveredfern
    Member
    Posted 1 month ago #

    Hello,

    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?

    Thanks

    Dave.

  2. fruitybeetle
    Member
    Posted 2 weeks ago #

    Hello,

    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?

    Paul

  3. overhaulmedia
    Member
    Posted 3 days ago #

    I am looking for the same thing! Any word?

  4. kwyjibo_AT
    Member
    Posted 3 days 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:

    http://www.php.net/manual/en/function.setcookie.php

    Greetings
    matthias

Reply

You must log in to post.

About this Topic