Pawan Kumawat

How to configure WordPress Auth Cookie Expiration

How to configure WordPress Auth Cookie Expiration .Meaning how to automatically logged out user after particular time of logged in.

WordPress provide  auth_cookie_expiration filter for setting logged in expiration time .

For setting logged out time please add this code to  functions.php of theme.

/* Login for only 1 hour */
add_filter( 'auth_cookie_expiration', 'keep_me_logged_in_for_1_hour',9999,1 );
function keep_me_logged_in_for_1_hour( $expirein ) {
    return 60*60; 
}

 

Share This On :

Leave a Comment

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

Categories
Scroll to Top

Request A Quote