Increasing logged-in expiry time of your wordpress website

shape
shape
shape
shape
shape
shape
shape
shape

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.

One Comment:

Leave a Reply

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