cookie timout of password protected sites (2 posts)

  1. florencerouge
    Posted 3 years ago #

    hello everyone,

    today I updated to wordpress 3.5 and now, one of my custom settings misses (I know this could happen - i simply forgot..):

    I customized the cookie timeout for password protected sites according a trick like this: http://originalexe.com/shortening-the-cookie-life-time-for-postpage-password/

    I already figured out, that the file wp-pass.php doesn't exist anymore and that the changes are made in the wp-login.php. But there it says:

    // 10 days
    setcookie( 'wp-postpass_' . COOKIEHASH, $wp_hasher->HashPassword( stripslashes( $_POST['post_password'] ) ), time() + 10 * DAY_IN_SECONDS, COOKIEPATH )

    and I don't know how I have to change the "10 * DAY_IN_SECONDS" thing, before there was just a number of seconds, easily to adjust.

    Sorry, if my problem is quite obvious, I hope someone could help me anyway?

  2. 3kolik
    Posted 3 years ago #

    It's easy :). It's a math. It couts 10*86400 (number of second in one day). So if you for example want instead of 10 days just 10 minutes you just must write DAY_IN_SECONDS/144

    Day in seconds is 86400 and if you divide it 144, you'll got 600 - number of seconds in 10 minutes :)

Topic Closed

This topic has been closed to new replies.

About this Topic