Skip to content

Commit 7b1496f

Browse files
Added support to set cookie through the API client. Example usecase: If someone wants to display an extern noVNC view he needs it. check http://forum.proxmox.com/threads/22817-noVNC-console-via-PHP-API?p=114793#post114793
1 parent 5255fda commit 7b1496f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pve2_api.class.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,14 @@ public function login () {
120120
}
121121
}
122122

123+
public function setCookie() {
124+
if (!$this->check_login_ticket()) {
125+
throw new PVE2_Exception("Not logged into Proxmox host. No Login access ticket found or ticket expired.", 3);
126+
}
127+
128+
setcookie("PVEAuthCookie",$this->login_ticket['ticket']);
129+
}
130+
123131
/*
124132
* bool check_login_ticket ()
125133
* Checks if the login ticket is valid still, returns false if not.

0 commit comments

Comments
 (0)