function load_agent_form(resource_id, stonith) {
  var url;
  var form;
  if (stonith) {
    form = $("#stonith_agent_form");
    url = '/managec/' + Pcs.cluster_name + '/fence_device_form';
  } else {
    form = $("#resource_agent_form");
    url = '/managec/' + Pcs.cluster_name + '/resource_form?version=2';
  }

  form.empty();

  var resource_obj = Pcs.resourcesContainer.get_resource_by_id(resource_id);
  if (!resource_obj || !resource_obj.get('is_primitive'))
    return;

  var data = {resource: resource_id};

  ajax_wrapper({
    type: 'GET',
    url: url,
    data: data,
    timeout: pcs_timeout,
    success: function (data) {
      Ember.run.next(function(){form.html(data);});
    }
  });
}
Authenticating a user, or otherwise establishing a new user session, without invalidating any existing session identifier gives an attacker the opportunity to steal authenticated sessions.