Types of runs: "logged in" runs

A "logged in" run is a special type of run that is linked to your account.

Explanation: You login to your user account on the "main" server: ancientbrain.com

Runs take place on the "run" server: run.ancientbrain.com where there is no user login.

However, some runs can have a form of "login" where they are linked to your account. The run can take certain very carefully controlled actions. It cannot take any normal user actions like delete World, change password, etc. No run page can take those actions.

The run can "save and restore" data

Run from the World page to run "logged in"

Runs are only "logged in" when run from certain pages:

Run situation Is the run logged in?
User is not logged in. No
User is logged in. Run is launched from World page (or Mind page or Edit page). Yes
User is logged in. Run is launched from other page. No

Different run URLs

When you run "logged in": When you run not logged in:

Passing information to run.php in the URL

Any page can pass information to the run window run.php in the URL. You pass information to the run window using:
This is parsed and appears in the run page JavaScript as a global variable:
 var AB_arg_NEWARG = "VALUE"; 
The World can then either process it or ignore it.

Both NEWARG and VALUE must be alphanumeric.

Sample use: One run starts another run and both runs are "logged in"

Here is a sample use of passing information to run.php.

The issue:

The solution:

See the AB variables used in calls which tells us the information needed for a World to "save data" to the server is:

World 1 sets up a link to a run of World 2 with this extra data as parameters:
 var url ="run.php?args&w=" + AB.worldid + "&u=" + AB.myuserid + "&d=" + AB.dataticket;
 // write a link with this URL for the user to click:
 AB.msg ( "<a href='" + url + "'>link</a>" );
World 2 retrieves the data and uses it to pretend to be World 1 to make the server call:
 AB.worldid    = AB_arg_w;
 AB.myuserid   = AB_arg_u;
 AB.dataticket = AB_arg_d;
 // if other parts of the code look at AB.runloggedin, it will be set to false 
 // so we might ignore that check, or set it manually: 
 AB.runloggedin	= true;
World 2 is now "logged in" as World 1 and can save data to World 1's space. World 1 has basically delegated its authority to World 2.

AB variables used in "save and restore data"

Here are the AB variables used in the "save and restore data" calls from run pages.

You can modify these as needed, but the ticket must match the call you are trying to make.

Server call AB variables used
AB.saveData AB.worldid
AB.queryDataExists AB.worldid
AB.restoreData AB.worldid
AB.getAllData AB.worldid