Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

Kolsyra on "PW Protected page don't ask for PW when..."

$
0
0

Hi,

I have added this code:

add_action( 'wp', 'post_pw_sess_expire' );
    function post_pw_sess_expire() {
    if ( isset( $_COOKIE['wp-postpass_' . COOKIEHASH] ) )
    // Setting a time of 0 in setcookie() forces the cookie to expire with the session
    setcookie('wp-postpass_' . COOKIEHASH, '', 0, COOKIEPATH);
}

into my functions.php and i t works fine when I click another page and then click the protected page again but if I use the back arrow in my browser it does not ask for the password again.

Can this be achived in any way?

/Kolsyra


Viewing all articles
Browse latest Browse all 8245

Trending Articles