Created
January 21, 2020 15:44
-
-
Save wpscholar/532907b827dd885a312618dfc6fa937d to your computer and use it in GitHub Desktop.
By default, WordPress will log you out when you close your browser. If you check 'Remember Me' WordPress will keep you logged in for 2 weeks. Your web browser stores a cookie that WordPress checks to see if you are logged in. It is possible to set the expiration for that cookie for longer than 2 weeks when a user checks the 'Remember Me' option.…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'auth_cookie_expiration', function() { | |
return 31556926; // 1 year in seconds | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment