code: public function addRememberMeCookie($userId, $options = [])
      {
          $options = Hash::merge([
              'expires' => '+14 days',
              'httpOnly' => true,
              'secure' => false
          ], $options);
  
          $this->Cookie->config($options);
          $this->Cookie->write('User.id', $userId);
      }
docs: Add a Remeber me cookie
  
  @param string $userId UserID
  @param string $options Options array for the cookie config
  @return void