Neil had asked about adding a "remember me" checkbox to the login form. The idea here is that if you're really forgetful (like me! Ack!) and you know you're really forgetful – and you know you're probably going to forget to "logout" before closing your browser – if you don't click the "remember me" checkbox – then when you close your browser, you will be automatically logged out of WordPress. (This is good when you're working on a shared computer)
It does require some core WP editing – minor tweaks to just the wp-login.php page – but wanted to warn you up front (I have to apologize for the core edits. I'm more than welcome to hear suggestions of how one can do this WITHOUT doing the core editing – but I just can't come up with it)
Open up wp-login.php. Look for the following codes (should be on lines 389 and 391) :
setcookie('wordpressuser_'.$cookiehash, $user_login, time() + 31536000, COOKIEPATH);
setcookie('wordpresspass_'.$cookiehash, md5($user_pass), time() + 31536000, COOKIEPATH);
and replace those two lines with the following:
if (isset($_POST['rememberme'])) {
setcookie('wordpressuser_'.$cookiehash, $user_login, time() + 31536000, COOKIEPATH);
setcookie('wordpresspass_'.$cookiehash, md5($user_pass), time() + 31536000, COOKIEPATH);
} else {
setcookie('wordpressuser_'.$cookiehash, $user_login, NULL, COOKIEPATH);
setcookie('wordpresspass_'.$cookiehash, md5($user_pass), NULL, COOKIEPATH);
}
(Passing "NULL" suggestion by Andrew in the comments thread) Then look for what will now probably be on line 313:
<p><label><?php _e('Password:') ?> <input type="password" name="pwd" value="" size="20" tabindex="2" /></label></p>
And add this just below it
<p><label>Remember me? <input type="checkbox" name="rememberme" value="rememberme" tabindex="3"></label></p>
Then, if you want to be "auto-logged-out" when you close your browser, just make sure you DON'T click that "remember me" checkbox
Post updated 10/7/2004 to reflect changes in WP 1.2.1