• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Logo

CITROWEB

First choice for your online presence

  • home page
  • Services
    • Web design, web development and consulting
    • Online stores with WooCommerce
    • Technical support for WooCommerce stores
    • Search engine marketing
      • SEO: Your website receives more relevant visitors
      • SEA: Search engine advertising for your website
    • Web hosting packages and domains
  • Blog
  • Contact us
Home » Blog » Change login cookie lifetime in WordPress

Change login cookie lifetime in WordPress

19. July 2022

"Stay logged in" at WordPress login

If you check “Stay logged in” when you log in (see image), WordPress will allow you to work longer in the WordPress backend without having to log in again.

If this checkmark is set, the lifetime of the authentication cookie is increased. However, the time is only extended by about half a month. If you want to stay logged in longer, for example because you want to work with WordPress every day, the following solution is available:

add_filter( 'auth_cookie_expiration', 'cwhf_extend_auth_cookie_to_1_year' );
function cwhf_extend_auth_cookie_to_1_year( $expirein ) {
	return 31556926; // 1 year in seconds
}

The above code must be added to the WordPress code. This is done via the Code Snippets plugin, the functions.php or a

Filed Under: development, WordPress

Primary Sidebar

Search

Recent Posts

  • Remove “Thank you for your trust in WordPress” from the bottom of the dashboard
  • Remove WordPress logo from toolbar
  • Change login cookie lifetime in WordPress
  • WordPress multisite and cookie settings in wp-config.php
  • Update GUIDs in WordPress after domain move

Footer

Logo




© 2023 CITROWEB
  • Data protection
  • imprint
  • Deutsch