Uncomfortable with having your WordPress blog keep subscribers and editors signed in even after closing their browsers?
Here’s how to delete cookies from your WordPress blog. You’ll have to modify a file in the root directory of your WP installation.
Look for the file called wp-pass.php – it should contain php code like so:
require( dirname(__FILE__) . '/wp-config.php');
if ( get_magic_quotes_gpc() )
$_POST['post_password'] = stripslashes($_POST['post_password']);
// 10 days
setcookie('wp-postpass_' . COOKIEHASH, $_POST['post_password'], time() + 864000, COOKIEPATH);
See that line that starts with setcookie?
All you have to do is change “864000” to “0” and the cookie drops from 864,000 seconds to zero seconds. So, the setcookie line should look like this:
setcookie('wp-postpass_' . COOKIEHASH, $_POST['post_password'], time() + 0, COOKIEPATH);
When the user closes their browser, the session is complete and the cookie is dropped. Users will have to log in again the next time they visit your blog.