最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

functions - how to increase connection time

programmeradmin1浏览0评论

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 badges
Add a comment  | 

1 Answer 1

Reset to default 0

Maybe 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*/}
发布评论

评论列表(0)

  1. 暂无评论