Part 1: A list of things
When page is run in a given mode, a 30-day cookie for that mode will be set to "true". The relevant line will be crossed out if the cookie is true.
Part 2: Pick a number
When you pick a number, it is circled and a cookie is set to that number. When the page is loaded, the number in the cookie is circled.
This seems about right, if you accept the "never-sync-cookies" solution. Nothing you do can ever change these states (well, at least until the cookies expire or are cleared).
This seems to be a bug. Somehow refreshing the page breaks the cookie transfer?
This seems to indicate that cookies are transferred based on the last-loaded state of the page. Makes sense — I guess document.cookie isn't be written out until the page is reloaded/replaced?
No idea.
I've done less testing in 4.1, because it's basically random.
Access this page in Safari: "Run in Safari mode" is crossed out.
Access this page in Standalone mode: "Run in Standalone mode" is crossed out.
Return to Safari and refresh. Re-enter Standalone mode: both lines are crossed out. This may be because it synchronised with Safari when it launched — unlike Safari, standalone web apps don't multitask, but relaunch each time they're accessed.
Return to Safari and refresh. Unpredictable, may be one or two lines crossed out.
When moving between Safari and standalone web app modes in iOS, strange things happen to cookie values.
In earlier versions of iOS, after "Add to Home Screen" and upon entering Standalone mode for the first time, no cookies are transferred from Safari.
Thereafter, Safari and Standalone cookies are kept in sync. BUT: synchronisation seems to occur on launch (but not every launch). So it doesn't really work. Safari is very rarely restarted now. Consequently, the cookies are mostly independent, but every now and then will overwrite each other more or less unpredictably.
It's the opposite behaviour.
When initializing the Standalone mode, all cookies from the Safari window are transferred. This seems to happen at the time of Add to Home Screen, not first access — but some bugs make it hard to tell.
Thereafter, forever and a day, the cookies are separate. Changing one has no effect on the other.