WordPress Login Remember me

When logging into a WordPress website there is a checkbox with text Remember me.

Ticking this box and logging in your details will be remembered for the next time. There will be no need to find and enter the username and password details.This lasts for 14 days.

If you are going to be using your computer on a public network then don’t tick the Remember me checkbox. Also its worth logging off prior to visiting a public network.

The default WordPress’ “Remember Me” feature has a cookie lifetime of 14 days. You can extend this more, or less if needed, with the auth_cookie_expiration filter. The associated code is added to the functions.php file in the theme.

function login_cookie_duration( $expire_in ) {
    return 31556926; //time in seconds.  31556926 = 1 year
}
add_filter( 'auth_cookie_expiration', 'login_cookie_duration' );