actually I'm using this script To increase the connection time
// Reste connecté à WordPress durant 1 an
add_filter( 'auth_cookie_expiration', 'keep_me_logged_in' );
function keep_me_logged_in( $expirein ) {
return 31556926; // 1 an en secondes
}
it works for some users but not for all, some users are often disconnected.
Where does the problem come from ? how to be sure to increase the session timeout
actually I'm using this script To increase the connection time
// Reste connecté à WordPress durant 1 an
add_filter( 'auth_cookie_expiration', 'keep_me_logged_in' );
function keep_me_logged_in( $expirein ) {
return 31556926; // 1 an en secondes
}
it works for some users but not for all, some users are often disconnected.
Where does the problem come from ? how to be sure to increase the session timeout
Share Improve this question asked Jun 16, 2019 at 13:22 kwizkwiz 153 bronze badges1 Answer
Reset to default 0Maybe your hook called too early. And after yours, this connection time changes elsewhere. Try to increase priority like that:
add_filter( 'auth_cookie_expiration', 'keep_me_logged_in', 99, 3);
function keep_me_logged_in( $expiration, $user_id, $remember ) {/*your code*/}