original_string: private function create(): CookieAuthSession
      {
          $response = $this->request($this->endpoint . $this->path, [
              RequestOptions::JSON => [
                  'username' => $this->username,
                  'password' => $this->password,
              ],
          ]);
  
          $body = $response->getBody();
          $body->seek(0);
          $contents = $body->getContents();
  
          $contents = json_decode($contents, true);
  
          if (isset($contents['session']['name'], $contents['session']['value'])) {
              return new CookieAuthSession($contents['session']['name'], $contents['session']['value']);
          }
  
          throw new \Exception('Failed to create ' . CookieAuthSession::class . '.');
      }
code: private function create(): CookieAuthSession
      {
          $response = $this->request($this->endpoint . $this->path, [
              RequestOptions::JSON => [
                  'username' => $this->username,
                  'password' => $this->password,
              ],
          ]);
  
          $body = $response->getBody();
          $body->seek(0);
          $contents = $body->getContents();
  
          $contents = json_decode($contents, true);
  
          if (isset($contents['session']['name'], $contents['session']['value'])) {
              return new CookieAuthSession($contents['session']['name'], $contents['session']['value']);
          }
  
          throw new \Exception('Failed to create ' . CookieAuthSession::class . '.');
      }
code_tokens: private function create ( ) : CookieAuthSession { $ response = $ this -> request ( $ this -> endpoint . $ this -> path , [ RequestOptions :: JSON => [ 'username' => $ this -> username , 'password' => $ this -> password , ] , ] ) ; $ body = $ response -> getBody ( ) ; $ body -> seek ( 0 ) ; $ contents = $ body -> getContents ( ) ; $ contents = json_decode ( $ contents , true ) ; if ( isset ( $ contents [ 'session' ] [ 'name' ] , $ contents [ 'session' ] [ 'value' ] ) ) { return new CookieAuthSession ( $ contents [ 'session' ] [ 'name' ] , $ contents [ 'session' ] [ 'value' ] ) ; } throw new \ Exception ( 'Failed to create ' . CookieAuthSession :: class . '.' ) ; }
docstring: Creates cookie auth session
  
  @return CookieAuthSession
  @throws \Exception If failed to create object
docstring_tokens: Creates cookie auth session