register.json does not login the user or return the user's session/token/password I have tried far too many variations to list here, but the basic point is I cannot get the user logged in immediately after registration via Services. I have tried a fresh Drupal 7.33 install with only Services 7.x.3.11 enabled and the default resource settings provided by drupalgap 7.x.1.9

When I register using the Drupal interface, the user is created, the session opened, and I land on my profile page logged in.

vs. 

When I call the Services endpoint /services/user/register.json, Drupal creates the account but the session does not persist. See my screenshots below.



How can I either A. get the session to persist for subsequent Service resource calls OR B. hook to add the user's or auto-generated password back into the json response so I can programmatically resubmit the /login.json form client-side (which does persist) ?

This question how could the global $user be different between the Drupal interface and Services module? describes my same problem using LoginToboggan.

In my screenshot you'll see a debug line called "login debug". It comes from line 333 of "/sites/all/modules/logintoboggan/logintoboggan.module" where I've tried all of this to no avail...

function logintoboggan_process_login($account, &amp;$edit, $redirect = array()){
  global $user;

  $user = user_load($account-&gt;uid);

//watchdog('login debug', json_encode($account)); 
watchdog('login debug', json_encode($edit));

  //user_login_submit(array(), array('uid' =&gt; $account-&gt;uid));
  user_login_finalize($edit);

//  $user = user_load($account-&gt;uid);
//  $user-&gt;token = drupal_get_token('services'); // WE HAVE A TOKEN ALTHOUGH I DOUBT THIS WOULD WORK IN TERMS OF SESSION PERSISTANCE
//  user_login_finalize($edit);
//  module_invoke_all('hook_user_login');
//  module_invoke_all('tripchi_user_login');
//  module_invoke_all('logintoboggan_user_login');
Not sure if you need an answer at this point (or if this is even one), but it looks like you have "Require e-mail verification when a visitor creates an account" turned on?

In your image, in the second window (where you see the message from drupal_set_message()), it says that an email was sent and you will need to follow instructions to gain full message. 

To turn this off, navigate to /admin/config/people/accounts and uncheck Require e-mail verification when a visitor creates an account.

If you look at the user table in the database, the status column should show a 1 for enabled, 0 for disabled (meaning he hasn't clicked on the link in the email). 

Hope it helps!