code: function(url, data, type) {
  		assert(Login.app, "You must set Login.app = my-app-name-as-registered-with-you-again");
  		data.app = Login.app;
  		data.withCredentials = true; // let the server know this is a with-credentials call
  		data.caller = ""+document.location; // provide some extra info
  		// add in local cookie auth
  		const cookies = Cookies.get();
  		let cbase = cookieBase();
  		for(let c in cookies) {			
  			if (c.substr(0, cbase.length)===cbase) {
  				let cv = Cookies.get(c);
  				data[c] = cv;
  			}
  		}
  
  		return $.ajax({
  			dataType: "json", // not really needed but harmless
  			url: url,
  			data: data,
  			type: type || 'GET',
  			xhrFields: {withCredentials: true}
  		});
  	}
docs: convenience for ajax with cookies