$response = $util->RESTCall($CFG->wblistadm_url.'/ticket', $data, $cookiesIn = '');
if ($response['http_code'] >= 200 && $response['http_code'] <= 204) {
$_SESSION['ticket'] = json_decode($response['content']);
- $_SESSION['token'] = $ticket->data->CSRFPreventionToken;
+ $_SESSION['CSRFPreventionToken'] = array('CSRFPreventionToken: ' . $_SESSION['ticket']->data->CSRFPreventionToken);
$_SESSION['cookies'] = $response['cookies'];
}
} else {
- $response = $util->RESTCall($CFG->wblistadm_url.'/show', $data, $cookiesIn = $_SESSION['cookies']);
- if ($response['http_code'] >= 200 && $response['http_code'] <= 204) {
+ $response = $util->RESTCall($CFG->wblistadm_url.'/show', null,
+ $cookiesIn = $_SESSION['cookies'], $_SESSION['CSRFPreventionToken']);
$data = json_decode($response['content']);
- $_SESSION['CSRFPreventionToken'] = 'CSRFPreventionToken='.$ticket->data->CSRFPreventionToken;
- $_SESSION['cookies'] = $response['cookies'];
- }
+ //$_SESSION['cookies'] = $response['cookies'];
}
?>
<pre>
<?php
print_r($response);
-print "Ticket: \n".var_export($_SESSION['ticket'],true)."\nCookies: ".$_SESSION['cookies']."\nToken: ".$_SESSION['CSRFPreventionToken'];
+print "Ticket: \n".var_export($_SESSION['ticket'],true)."\nCookies: ".$_SESSION['cookies']."\nToken: ".
+ var_export($_SESSION['CSRFPreventionToken'], true);
if (isset($data)) {
print "\n";
print_r($data);