Configuring WordPress Auth Cookie Expiration

Note that you’re not adding any filter callback with: apply_filters( ‘auth_cookie_expiration’, $expiration ); Instead use: add_filter( ‘auth_cookie_expiration’, $callback, 10, 3 ); where $callback is the appropriate filter callback that modifies the expiration. Here’s an example add_filter( ‘auth_cookie_expiration’, function( $length, $user_id, $remember ) { return $length; // adjust this to your needs. }, 10, 3 ); … Read more