Support » Fixing WordPress » Login Timeout !

Viewing 2 replies - 1 through 2 (of 2 total)
    • Try deactivate all plugin to troubleshooting
    • Try use another web browser.

    If you still have problem log in, make sure your hosting server is on good condition.

    Thread Starter alshizawi

    (@alshizawi)

    I fix it by adding this snippet for Session Expiration Time :

    /** Session Expiration Time - Login Time */
    
    add_filter('auth_cookie_expiration', 'my_expiration_filter', 99, 3);
    function my_expiration_filter($seconds, $user_id, $remember){
    
        //if "remember me" is checked;
        if ( $remember ) {
            //WP defaults to 2 weeks;
            $expiration = 14*24*60*60; //UPDATE HERE;
        } else {
            //WP defaults to 48 hrs/2 days;
            $expiration = 2*24*60*60; //UPDATE HERE;
        }
    
        //http://en.wikipedia.org/wiki/Year_2038_problem
        if ( PHP_INT_MAX - time() < $expiration ) {
            //Fix to a little bit earlier!
            $expiration =  PHP_INT_MAX - time() - 5;
        }
    
        return $expiration;
    }
    
    • This reply was modified 7 months, 3 weeks ago by alshizawi.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Login Timeout !’ is closed to new replies.