Invalid form POST data - ajax for Authenticated users
OK think I have it.

As form_form-ymw-BN0Zhp9j2CZf82mZzslbUBiLo8kZbreXhB1y8kE was not being set I looked at form_set_cache().

/**
 * Stores a form in the cache.
 */
function form_set_cache($form_build_id, $form, $form_state) {
  // 6 hours cache life time for forms should be plenty.
  $expire = 21600;

  // Cache form structure.
  if (isset($form)) {
    if ($GLOBALS['user']-&gt;uid) {
      $form['#cache_token'] = drupal_get_token();
    }
    cache_set('form_' . $form_build_id, $form, 'cache_form', REQUEST_TIME + $expire);
  }

  // Cache form state.
  if ($data = array_diff_key($form_state, array_flip(form_state_keys_no_cache()))) {
    cache_set('form_state_' . $form_build_id, $data, 'cache_form', REQUEST_TIME + $expire);
  }
}


I dug into cache_set()

function cache_set($cid, $data, $bin = 'cache', $expire = CACHE_PERMANENT) {
  return _cache_get_object($bin)-&gt;set($cid, $data, $expire);
}


I then looked into set()

  /**
   * Implements DrupalCacheInterface::set().
   */
  function set($cid, $data, $expire = CACHE_PERMANENT) {
    $fields = array(
      'serialized' =&gt; 0,
      'created' =&gt; REQUEST_TIME,
      'expire' =&gt; $expire,
    );
    if (!is_string($data)) {
      $fields['data'] = serialize($data);
      $fields['serialized'] = 1;
    }
    else {
      $fields['data'] = $data;
      $fields['serialized'] = 0;
    }

    try {
      db_merge($this-&gt;bin)
        -&gt;key(array('cid' =&gt; $cid))
        -&gt;fields($fields)
        -&gt;execute();
    }
    catch (Exception $e) {
      // The database may not be available, so we'll ignore cache_set requests.
    }
  }


Here an exception is caught and not reported. I added a dd() into catch. Looking in drupal_debug.txt

[message:protected] =&gt; SQLSTATE[08S01]: Communication link failure: 1153 Got a packet bigger than 'max_allowed_packet' bytes


I have now increased the value of max_allowed_packet in MySQL. It has fixed things.

With this information I did some more googling and found this post. They have had the same problem that I had.