Keep me Logged In

Keep me Logged In and Change Cookie Expiration to One Year.

<?php
/**
 * Set a custom expiration time for authentication cookies.
 *
 * @param int $expire Default expiration time in seconds.
 * @return int Modified expiration time in seconds.
 */
function rk_keep_me_logged_in( $expirein ) {
    return 31556926; // 1 year in seconds
}
add_filter('auth_cookie_expiration', 'rk_keep_me_logged_in');

Post Comment