You just need to add your filter hook like this:
function myplugin_cookie_expiration( $expiration, $user_id, $remember ) {
return $remember ? $expiration : 600;
}
add_filter( 'auth_cookie_expiration', 'myplugin_cookie_expiration', 99, 3 );
You can add it to your theme’s functions.php file.
Related Posts:
- how to logout user on browser tab or window closes
- Custom Connect to Facebook, problem logging in/logging out
- Session Experies and Get Logged Out Within Few Minutes
- Preventing session timeout
- Removing username from the ‘wordpress_logged_in’ cookie
- Disable WordPress 3.6 idle logout / login modal window / session expiration
- How to pass users back and forth using session data?
- How to fake a WordPress login?
- Does wp_logout_url() destroy a session? (Logging out question)
- share login/logout sessions across two installs?
- How can I test the login for an expired session?
- How do I extend auto logout on idle OR redirect inline popup
- How long do users stay logged in if they DON’T check remember me?
- How to get login data (session) outside WordPress?
- How can I test the login for an expired session?
- How does WordPress handle sessions?
- Preexisting login to change to logout link in sub menu
- WordPress as webapp login session
- Share WordPress login info with other PHP app
- WordPress error on log out ‘Not Permitted’ and can’t log out
- Add logout link when logged in, make it disappear when logged out?
- Lock out all WordPress Administrators except two specific users
- How to remove ‘wordpress…’ text from page titles in tabs
- One time login on 2 different WordPress sites
- add class to element if user is not logged in [closed]
- End session screen not close automatically after login
- Problem with is_user_logged_in() function in some pages
- wordpress login loop and session problem
- Get WordPress logged in username from root domain when WP is installed in a subfolder
- Why deleting/removing cookies in WordPress does not log me out from admin?
- User not logged first time I open the homepage
- wp_logout logging everyone out instead of just the user that clicked the logout link!
- How to limit user to login only once per session
- how to manage Session in WordPress using custom login?
- Inconsistent login state
- Can i hide a dynamically created div to logged out users?
- Can’t log in: “ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.”
- SSO / authentication integration with external ‘directory service’
- wp_signon returns user, but the user is not logged in
- How to remove the WordPress logo from login and register page?
- How to log out everywhere else, destroy all sessions “all other devices”?
- My login form does not work
- Change Login Page for a Multisite Subsite
- Change admin login URL
- Login with cookie but without using WordPress code
- wp-admin redirecting to wp-login.php
- Get wordpress stored cookies for custom login
- Can’t access login page after password reset
- Rendering of custom walker menu function not working properly
- Is there any way to check for user login and send him to login?
- Show menu item only if user is logged In (not word press login)
- Login as a client no dashboard menu?
- How to edit comment_reply_link
- Right practice to edit WP reset password email
- deny IPs from wp-login using .htaccess
- How To Change Wp Register/Login URL Permanently To My Custom Page
- How can I prevent my custom form from redirecting to wp-login?
- wp-admin returns 404 [closed]
- disable site_url redirect in wp-login.php
- Forgot password needs to redirect from wp-login to a custom page
- Force login for a subdirectory within wordpress install
- Redirect login page except on reset pass
- Redirect to custom variable
- Get the url of custom login page in the registration page
- How to make wp-login.php not accessible
- Enqueue new login style sheet
- WordPress Conditional Login Links
- Secure login on wordpress [closed]
- Do more action after login successfully
- How can I password protect a WordPress site without requiring users to log in?
- Can’t login to my own website
- Can I Get User ID at Login?
- Cannot log into migrated site
- I want login using email not username wordpress front end
- How to Remove default “Login” link
- How to unpublish my new site while working on it?
- Reset Password Limit not working
- User not able to sign in after wp_authenticate() and wp_signon() wordpress
- WordPress site login Redirect
- On Homepage “is_user_logged_in()” function is not working after login and it is working after refresh the page?
- Cant reset password my wordpress password not even with phpMyAdmin
- How to invalidate `password reset key` after being used
- wp-cron event doesn’t run when custom login API is enabled
- Does it make sense to check a nonce on user log in?
- Special link for no automatic login (no username and no password)
- Global login to password protected pages
- Disable / Remove Password for Login WordPress
- WordPress Auto Login From Email Link
- Building a custom login form – encountering issues
- Making sure two different wordpress website has auto login
- How do i Redirect specific user(WooCommerce Sign-in not wordpress admin page sign-in) to specific page
- Chosen user password in registration is not being accepted on Login
- Improvements to “limit login attempts” plugin
- Add a required field to Registration
- Can’t login through wp-login.php on fresh installation
- Using wp_login_form passowrd as undefined
- Redirect non-members to about/intro page
- Handle POST request sent from an external site for login?
- Unable to login after adding ReCaptacha without API key
- Remove login link from Reset Password-screen