Don’t know if this is the best way, but I’ve been using this in functions.php in my themes:
function keep_me_logged_in_for_1_year( $expirein ) {
return 31556926; // 1 year in seconds
}
add_filter( 'auth_cookie_expiration', 'keep_me_logged_in_for_1_year' );
Related Posts:
- Adding extra authentication field in login page
- Force user to login in home page
- How to modify the action attribute of the wp-login.php?action=register form?
- WordPress and Magento: let WordPress manage user registration and logins?
- Increase of failed login attempts, brute force attacks? [closed]
- How to prefill WordPress registration with social details
- Redirect user using the ‘wp_login_failed’ action hook if the error is ’empty_username’ or ’empty_password’
- wp_signon() does not authenticate user guidance needed
- Disable WordPress 3.6 idle logout / login modal window / session expiration
- Avoid to load default WP styles in login screen
- How do I use add_action from a class method?
- I want to disable E-Mail verifcation / activation when a user signs up for my WordPress site
- How do I check if a post is private?
- What is the proper way to apply the login_form_bottom filter?
- Action wp_login_failed not working if only one field is filled out
- Display last login time
- Intentionally Force Failed Login WordPress
- Show newly added posts since last user login time /date
- What hooks should I use for pre-login and pre-registration actions?
- setting a specific home page for logged in users
- how to update current logged user username
- Custom Reset Password & Forgot Password Front End Forms
- How do I remove the eye icon that shows visibility on login screen and reset password screen
- Admin user getting message ‘You need a higher level of permission’
- How to implement Google reCaptcha without installing a plugin?
- Problem with logging in WP users automatically
- advance membership managment
- Logins through alias
- Remove WordPress Login Animation
- Redirect users to a front end wp login page
- How can I allow access to multiple users, using the same login, at the same time?
- Deny a user role to log in after register
- wp_get_referer not working properly after wp_redirect
- Login Button CSS
- Force Users to Login – loop problem
- Adding a login form that concatenates three fields into a username
- Is there a better way than checking user is logged in to show or hide adminbar?
- How do I replace “Username” in the WordPress login form?
- How can I do a URL redirection when an user uses wrong login details?
- Show errors on custom login form [duplicate]
- Change login_message using title
- Custom login with external provider iframe and data object
- Changing WP login credential [closed]
- Lost password empty field error redirect to custom login
- Index page and random posts needs a forced refresh in order to show new content
- How to change wordpress Log In text
- Can I (and should I) change the login-URL from functions.php?
- A truely custom login page?
- WordPress Cant access wp-login.php
- How to remove ‘wordpress…’ text from page titles in tabs
- Using gettext to translate wp-login.php can’t translate `Back to` into other language
- Code for Log Out Button Yields Strange URL
- Display first name instead of username
- How can I make a login just like on wordpress.org?
- How to Prevent Brute Force Attack on WordPress
- How can I insert wordpress login screen on a different domain?
- autocomplete=”off” WordPress Login
- Why there is a 302 status when my account and password are right?
- 503 Login WordPress [closed]
- Password recovery URL has error – but not found in code or db
- Cannot Get User id after login success in file wp_login.php
- This webpage has a redirect loop issue
- authenticate user without redirecting
- Create front end member login
- Logging in to the frontend works correctly but not for WP-Admin
- I can’t access my wp-admin dashboard
- Cannot login to WordPress on one device: login refreshes/an error was encountered whilst trying to authenticate
- How to block specific user id in custom login form?
- how to change the url rediction of the woocommerce login page of the flatsome theme for my own in wordpress?
- Make an order of products without login
- Updated : how to make email optional while user registration using default wordpress form
- I can’t log in to `wp-admin` after changing my domain
- My wordpress site crashes when I login!
- End session screen not close automatically after login
- Unable to login with email address as the username – WordPress
- Bypass login page
- Using WordPress login for a non word-press website
- Using is_user_logged_in() to lock down whole site
- After moving WordPress to its own directory, login doesn’t work
- Issue logging in from second computer
- Login problem with https
- How to Create a login for for subscribers only
- WordPress auto login user after registration only from a specific page
- Custom Field For Login
- User login without username, only password
- Opening protected page with cookie?
- Login user after registration programmatically
- wp_lostpassword_url not escaped
- Show Site Name on WP login screen
- Directory authentication initially succeeded, but no valid profile was found (“get entries” procedure)
- External Authentication
- Trim the repeated value in URL
- Warning: session_start(): Cannot send session cookie – headers already sent by
- how to manage Session in WordPress using custom login?
- Login to wordpress with filezilla client [closed]
- I can’t login to wordpress dashboard without SSH
- Member Area Login with Fail Message
- Username character requirements
- Login and register by API
- Log in a user upon password reset?