• Hi

    I set up a password protected page and uploaded a few documents to it. I added a function to end the session when the browser closed because otherwise it stayed open even after closing the browser. It was all working fine across ie, chrome and firefox but within few hours logging in resulted in a page not found, although I had changed nothing.

    Here is the function:
    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);
    }

    Can you please advise?

    Thanks

  • The topic ‘password protect page stopped working shows page not found’ is closed to new replies.