Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Last active May 25, 2021 10:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pebblo/b6e20b03c57efe693bd86ebcf1b00ce9 to your computer and use it in GitHub Desktop.
Save Pebblo/b6e20b03c57efe693bd86ebcf1b00ce9 to your computer and use it in GitHub Desktop.
Change the EE session lifepsan time
<?php //Please do not ad the opening PHP tag if you already have one.
function tw_ee_change_session_lifespan() {
// Set the value here to be the number of minutes you want the sesssion to be
// EE uses 60 buy default (1 hour) but here we change it to 15. Simply use another value for that lenth of time so,
// 15 = 15 minutes, 30 = 30 minutes etc
$minutes = 15;
//Return the number of minutes in seconds as that is what is used by PHP.
return $minutes * MINUTE_IN_SECONDS;
}
add_filter( 'FHEE__EE_Session__construct___lifespan', 'tw_ee_change_session_lifespan');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment