Increasing logged-in expiry time of your wordpress website

Waqas Yousaf October 14, 2016 1 Comment

Why Increase Loggin-in Expiry Time

Sometimes while developing a wordpress website, you dont want wordpress to log you off automatically from the website you are working on or in an other case, you might want to increase log-in expiry timer for your website’s users. Here’s a tiny piece of code that you can copy and paste into your functions.php file to help achieve the goal.

Source Code

[php] add_filter( ‘auth_cookie_expiration’, ‘loggedin_for_10days’ );

function loggedin_for_10days( $expire )
{
return 864000; // 10 days in seconds
}
[/php]

 

You can reach Waqas Yousaf through twitter @wiqi.
AboutWaqas Yousaf
Waqas Yousaf is a senior web applications developer and social media marketing wiz.
In Socials:

Comment (01)

  1. Teri
    October 18, 2016

    I don’t leave loads of comments on plenty of blogs but i felt i had to here.
    Quality articles you have here.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *