As we know by default WordPress keeps logged in for 48 Hours
. If we check “Remember me” while login then it will keep login for 14 Days.
If you want to set the logout timeout you can use this code as:
function wpset_change_cookie_logout( $expiration, $user_id, $remember ) {
if( $remember && user_can( $user_id, 'manage_options' ) ){
$expiration = 31556926;
}
return $expiration;
}
add_filter( 'auth_cookie_expiration','wpset_change_cookie_logout', 10, 3 );
Related Posts:
- wp_enqueue_script was called incorrectly
- Masking logout URL
- How can I tell if I’m on a login page? [duplicate]
- Is it possible to use a forgot password url filter?
- redirect wp-login.php to another page
- Login using the password from protected pages
- How do I redirect upon login a specific user based on role?
- Logging in redirects to correct page but shows logged out content until forced refresh
- Remove default user registration, login and subscriber profiles
- is_user_logged_in not working to redirect only logged out users
- Members only site – still need the lost password page accessible
- How to change login labels
- How can I get my Script to work on the Login page?
- Login Redirect if Logged in from Specific Page
- Unable to login using username
- When a user logs in, how can they view the website instead of the admin menu?
- WordPress PHP Conflicting User Sessions
- Get User Login Data (date, time… )
- Registration Hooks don’t appear to be working
- If user is logged-in display/hide something
- Secondary Menu and Logged In Users
- error at login page in wordpress
- Add Login/Logout Menu Item to Primary Nav “My Account” Submenu [Woocommerce] [closed]
- Logout Redirect and also WP-login.php Redirect
- loginout function customization
- Add Login and logout buttons to top menu bar
- Show errormessages on wrong username/password on custom loginform?
- WordPress login set cookie that survive browser exit (wp_signon function)
- This code is supposed to only allow user to be authenticated if accountVerified is equal to 1, but it still allows user to be authenticated otherwise
- Prevent wp_signon redirect on failed login for ajax login
- How to redirect Subscribers on login to specific page, when logging in from a Page
- How to replace ACTION url from original wordpress login form?
- Unable to login after registration
- Allow logged in user to view a Page, else send to login screen and then redirect back to Page
- Redirect after login to current URL
- Login functions
- WordPress permanently logging users out
- How to request login for user but not for bots
- is_user_logged_in() isn’t working
- update_user_option not working as expected
- “Headers already sent” while trying to add a CSS file to my login page?
- How to paginate the get_users function?
- opening links in new tab using – add_filter( ‘the_content’, ‘make_clickable’);
- How to add classes to images based on their categories?
- Compare post levels and user levels wishlist member
- Change ul class=”children” for wp_list_pages?
- Target a certain page within wordpress backend (admin) i.e. Pages > About
- Set default options for inserting media
- Session is not starting
- Hide WYSIWYG editor on certain templates
- Polylang: pll_e() & pll__() on functions.php, doesn’t work
- Disable shortlinks like ?p=1234 to prevent scraping
- Redirect a list of URLs to another URL, using functions.php
- WP_Remote_Get Not working
- Debugging with functions.php
- Getting first Image from post
- Inserting a functions output after the content
- Combine two different filter callback functions
- How to limit character length in BuddyPress function output [closed]
- Ordering posts by publish date not working?
- How to install Segment on WordPress without a plugin
- How to search using ajax for exact phrase or words in an input field?
- Dashboard widget custom positioning?
- Display tags that only appear in one category
- Need help “sanitizing” a custom function that pulls category slug into body class
- How to get data from an array using get_user_meta()
- Space Not Being Generated in HTML Output?
- Auto Generated HTML source code formatting
- Do not show on homepage functions.php code needed
- How can I show immediate and/or parents in a title?
- Passing Jquery value to WordPress function
- How to pass variables from one function to another or combine functions
- Unable to add extra elements to the main navi (wp_nav_menu_items)
- Internet Explorer opens links to .msi files as text in a new tab
- call wp_insert_user in custom class doesnt work
- Overwriting TwentyTwelve template file with child theme template, but lower in the hierarchy
- A better way to get stats
- Get URLs for AJAX Filter Checkboxes WordPress
- page shows short code not output
- Scheduled post delete – can’t pass the cron arguments
- Prevent function from triggering on current page
- Assign IDs to headings in ACF using functions.php
- Multiple Notifications SetInterval
- Child Theme not loading multiple stylesheets
- Show number of sold products but be first for less than 2
- Class::$template_dir_path=get_template_directory();
- admin-ajax.php & my wp-admin folder url showing in header
- Fatal error: Call to undefined function add_action() – an untouched problem
- How to wp_enqueue_script with html?
- Is it possible to change parameters of Parent theme function in the Child theme?
- Error function main() is a non-object to construct my Ajax.php
- Combining wp_current_user() and a variable
- Init hook for header send
- java script error Uncaught SyntaxError: Unexpected token ILLEGAL
- Gravity Forms After Submission – GFFormsModel::update_lead_field_value?
- Should I use `get_stylesheet_uri()` or `get_template_directory_uri()` when calling my CSS Stylesheet?
- new to javascript – using in instead of functions.php, not loading correctly
- Remove Disqus JavaScript from homepage
- Missing argument 2
- Get all users from role and add to dropdown (select) – wordpress, javascript