protected function apply_current_section( Form $form ) {
		if ( count( $this->sections ) === 0 ) {
			return;
		}

		// Make sure we don't have any active section before.
		foreach ( $this->sections as $section ) {
			$section->options['active'] = false;
		}

		$current = $this->current_section_in_cookie( $form->get_id() );

		if ( ! $current && $form->get_config()->has_option( 'active_section' ) ) {
			$current = $form->get_config()->get_option( 'active_section' );
		}

		// Use first section as fallback.
		if ( ! $current || ! isset( $this->sections[ $current ] ) ) {
			$current = Arr::first( array_keys( $this->sections ) );
		}

		if ( $section = $this->get_section( $current ) ) {
			$section->options['active'] = true;
		}
	}