Home / functions.php / Extend auto logout period
  • How to Extend auto logout period

    no thumbnail sorry: Extend auto logout period

    Adding this PHP code to the functions.php of your wordpress theme will extend the length of time cookies are kept the example is set to 1 week. Please note the value is defined in seconds

    ( click code to copy )

    wordpress snippet : PHP

    <>
    function logged_in( $expirein ) {
       return 604800; // 1 week in seconds
    }
    add_filter( 'auth_cookie_expiration', 'logged_in' );
    

    ( WordPress codex functions, hooks, in this snippet. )

    add_filter, _e, _ex,