Creating a node with PHP cURL client returns 401 error - X-CSRF token always empty A recent update to Services and Drupal requires a csrf token, and it broke the PHP cURL client samples. 

I am trying the sample code for Services to:


Create a node here https://drupal.org/node/1334758
Log in a user here https://drupal.org/node/1491754


It fails with 401 error. $csrf_token is always empty for me, so that should be the problem, but I am not sure how to return it with cURL. Any tips?
I fixed the DrupalREST class by Randall Kent here https://github.com/RandallKent/DrupalREST.PHP/issues/2