function initSession() {
$postData = [
"j_username" => $this->user,
"j_password" => $this->pass,
];
$postStr = self::preparePost($postData);
$loginUrl = $this->url . '/j_security_check';
$this->ch = $ch = curl_init();
curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($this->ch, CURLOPT_URL, $loginUrl);
curl_setopt($this->ch, CURLOPT_HEADER, true);
curl_setopt($this->ch, CURLOPT_POSTFIELDS, $postStr);
curl_setopt($this->ch, CURLOPT_HTTPHEADER, array('Host: ' . $this->nriRealIp));
$result = curl_exec($this->ch);
$cookies = self::Get_cookies($result);
curl_setopt($this->ch, CURLOPT_COOKIE, $cookies);
curl_setopt($this->ch, CURLOPT_URL, $this->url.'/menu');
$result = curl_exec($this->ch);
$cookies .= self::Get_cookies($result);
curl_setopt($this->ch, CURLOPT_URL, $this->url.'/PlanDevelopNet-web/
planList.do?&user='.$this->user);
$result = curl_exec($this->ch);
$cookies .= self::Get_cookies($result);
curl_setopt($this->ch, CURLOPT_URL, $this->url.'/nrijs-web/dialogs/objectPermissionsSetup-js.jsp');
$result = curl_exec($this->ch);
$cookies .= self::Get_cookies($result);
$this->cookies = $cookies;
echo "...session inited\n";
}