Is it possible to set Cookie Session ID from a REST Service? I have overridden Drupal's login process by calling a REST API which returns a 'true' or a 'false' depending on whether the login was successful or not. Once successful, I'm logging the user in by using a particular Drupal user account.

Would it be possible to change Drupal's Session ID to the one specified by the REST API call? Currently the REST API Call is giving me a JSESSIONID cookie and I was wondering if its possible to map this cookie to the one Drupal generates when the user logs in. Reason I need this is because I need keep track of this JSESSIONID to call other API methods related to the logged in user.
You cant save off the JSESSIONID into the user attributes, eg data column, in D6 or D7. You simply do this in your code with:

$_SESSION['JSESSIONID'] = /* some value here */;


or wherever you call user_save() in your custom login you can pass $edit['data'] = array('jsessionid' =&gt; 12341234); from the user_save documentation:


  $edit: An array of fields and values to save. For example array('name'
  => 'My name'). Key / value pairs added to the $edit['data'] will be serialized and saved in the {users.data} column.


it then becomes accessible from a fully loaded $user object as simply a field of the user ... $jsessionid = $user-&gt;jsessionid; and you can use it as needed.