recovery_mode_cookie_length

recovery_mode_cookie_length

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: wordpress-6.7.2

apply_filters('recovery_mode_cookie_length') is found 2 times:

  • /wp-includes/class-wp-recovery-mode-cookie-service.php line 46
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    * @since 5.2.0
     *
     * @param int $length Length in seconds.
     */
    $length = apply_filters( 'recovery_mode_cookie_length', WEEK_IN_SECONDS );
     
    $expire = time() + $length;
     
    setcookie( RECOVERY_MODE_COOKIE, $value, $expire, COOKIEPATH, COOKIE_DOMAIN, is_ssl(), true );
     
    if ( COOKIEPATH !== SITECOOKIEPATH ) {
  • /wp-includes/class-wp-recovery-mode-cookie-service.php line 99
    095
    096
    097
    098
    099
    100
    101
    102
    103
    104
    105
        return new WP_Error( 'invalid_created_at', __( 'Invalid cookie format.' ) );
    }
     
    /** This filter is documented in wp-includes/class-wp-recovery-mode-cookie-service.php */
    $length = apply_filters( 'recovery_mode_cookie_length', WEEK_IN_SECONDS );
     
    if ( time() > $created_at + $length ) {
        return new WP_Error( 'expired', __( 'Cookie expired.' ) );
    }
     
    $to_sign = sprintf( 'recovery_mode|%s|%s', $created_at, $random );