security - What's the easiest way to stop WP from ever logging me out

After a certain amount of time WP logs out all users and forces them to log back in again. For development environments

After a certain amount of time WP logs out all users and forces them to log back in again. For development environments on my local machine this is obnoxious and absolutely unnecessary.

Is there an API-driven way of disabling the auto-logout indefinitely? Ideally I'd like something I can add to wp-config.php along with other dev-setup-related settings.

A plugin would be overkill for me so I won't consider it an answer, but you might as well post it as an option.

After a certain amount of time WP logs out all users and forces them to log back in again. For development environments on my local machine this is obnoxious and absolutely unnecessary.

Is there an API-driven way of disabling the auto-logout indefinitely? Ideally I'd like something I can add to wp-config.php along with other dev-setup-related settings.

A plugin would be overkill for me so I won't consider it an answer, but you might as well post it as an option.

Share Improve this question asked Aug 18, 2010 at 20:21 jerclarkejerclarke 3,0832 gold badges28 silver badges35 bronze badges 0
Add a comment  | 

2 Answers 2

Reset to default 32

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
}

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?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744789848a4593849.html

相关推荐

  • security - What's the easiest way to stop WP from ever logging me out

    After a certain amount of time WP logs out all users and forces them to log back in again. For development environments

    9小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信