WordPress Snippets at WPcustoms

Change login cookie expiration date

This function changes the expiration date so your login cookie does not expire every 2 weeks.


/**
 * Snippet Name: Change login cookie expiration date
 * Snippet URL: http://www.wpcustoms.net/snippets/change-login-cookie-expiration-date/
 */
 function wpc_expire_login_cookie() {
    return 31536000; // one year in seconds: 60 * 60 * 24 * 365
}
add_filter( 'auth_cookie_expiration', 'wpc_expire_login_cookie' );