I read this comment earlier (quoted in case it's removed, emphasis mine) and If a Pokémon is shiny for someone, is it shiny for everyone in the same location?:
I also can confirm this: I just had a regular Magikarp on the map. Once the battle started it was yellow and had sparkles. So yeah, you need to invoke the battle. It wasn't shiny for another person, though
The same Pokémon was shiny for one person and not another. This surprises me, because Pokémon are otherwise the same for all: same IVs and same CP for people on the same level (this has been my experience, playing with my partner of the same level; however, this does not appear to be other people's experience)
What determines the shiny nature of a Pokémon? Is it determined for each player when it spawns, or when a player clicks the Pokémon? Does running and re-entering affect this (i.e. does running from a shiny and reclicking it keep its shininess)?
Answering the last question should be enough to answer the first two.
Best Answer
Based on the experiment conducted in this thread, it's shown that the shininess of a Pokémon is determined serverside rather than clientside.
That is, the shininess of a Pokémon isn't determined once you click on it; it was already determined when it spawned. If this were not the case, it would be possible to constantly restart your app after encountering a Magikarp to try to have it appear as a shiny eventually. Conversely, restarting the app after encountering a shiny Magikarp would likely mean that that same Magikarp would no longer be shiny if you re-encountered it.
To prove this, the OP of the above thread encountered a shiny Magikarp then restarted their app. When they re-encountered it, it was still a Shiny.