Is there a way to password protect multiple pages with one password and also have that password expire after X hours? The user would be able to login to any page with the same password and then be given access to all other pages that use that same password with one added ability that the password expires after 3 hours of use.
Some code I've tried that accomplishes the time to live on the password is here:
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, '', 10800, COOKIEPATH);
}
Any help would be appreciated! Thank you!