Support » Everything else WordPress » Passworded pages (need cookie to expire.)

  • Hey guys. Would just like to know if there’s any easy way (maybe a plugin?) to adjust how long the cookie takes to expire for password protected pages. My site will have a student/teacher audience and may be accessed at the same computer so I’m fairly keen to make use of this cool little feature.

    I don’t really want to hunt around in the wp code to find where this is set because (a.) while I could probably do an ugly hack, I don’t really know what I’m doing and (b.) I’d need to redo it when a new version came along.

    Anybody know anything about this ? Any suggestions much appreciated, James.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Cool, thanks for that link, looks like a handy plugin but not really what I was after (although I’ll probably use it once I start giving out accounts…)

    The cookie I’m interested in is the one that control access to individually passworded published WP pages. It’s independant of login and persists for a long time. Perhaps I can work something out from that plugin if I drink enough coffee tonight.

    Sorry, I thought it handled post passwords, too.

    Well, you could hack wp-pass.php for this. In that file, look for:

    // 10 days
    setcookie('wp-postpass_' . COOKIEHASH, $_POST['post_password'], time() + 864000, COOKIEPATH);

    The number (864000) is the amount of seconds the wp-postpass cookie remains valid.

    Cheers for that, it should really help. WordPress people are so damn nice….


    Wow! I didn’t expect to find this answer in the support forums, but it was here! This is exactly what I needed, as I’m having the exact same problem as the FreeMoby describes on the plugin page. Thanks a ton!!!!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Passworded pages (need cookie to expire.)’ is closed to new replies.