Skip to content

Instantly share code, notes, and snippets.

@bueltge
Created September 6, 2012 07:15
Show Gist options
  • Save bueltge/3652459 to your computer and use it in GitHub Desktop.
Save bueltge/3652459 to your computer and use it in GitHub Desktop.
Set the time that the cookie in WordPress will be kept at 1 year.
<?php
/**
* Plugin Name: Keep me Logged In for 1 Year
* Plugin URI: http://bueltge.de/wordpress-login-unterbinden/1220/
* Description: Set the time that the cookie will be kept at 1 year.
* Version: 0.0.1
* Author: Frank B&uuml;ltge
* Author URI: http://bueltge.de/
*/
if ( ! function_exists( 'keep_me_logged_in_for_1_year' ) ) {
add_filter( 'auth_cookie_expiration', 'keep_me_logged_in_for_1_year' );
function keep_me_logged_in_for_1_year( $expirein ) {
return 31556926; // 1 year in seconds
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment