This cheat for staying alive in hardcore mode was new to me. I tried to google it but didn‘t find anything. I wonder if it works both in Java and in Bedrock.
The player falls into lava and immediately quits the game in shock. When he reloads, his health doesn‘t immediately diminish so he can swim towards shore. He keeps repeating this process (quitting and reloading) until he is on dry land and stops burning.
For me it is only a curiosity since I don‘t play hardcore and I wouldn‘t mind losing my stuff in lava if I fell in.
Yes, it has gone on for years, players logging in on a server (even the integrated server which is launched in singleplayer) have a period of damage immunity. This applies also to damage dealt by mobs. This effect doesn't seem described in any way on the Wiki damage page (I don't know if it's described in any other page of the official wiki).
This is an old bug which somehow hasn't been fixed yet (this is surely even older than the almost 8 years indicated as the bug tracker didn't exist until 1.4.2 based on the oldest reports, likely back to 1.3.1 in singleplayer and possibly earlier in multiplayer):
This is code from 1.6.4 that shows that there is a field called "initialInvulnerability" which is set to 60 when a player object is created and all damage is negated until it reaches 0:
/** de-increments onUpdate, attackEntityFrom is ignored if this >0 */
private int initialInvulnerability = 60;
boolean var3 = this.mcServer.isDedicatedServer() && this.mcServer.isPVPEnabled() && "fall".equals(par1DamageSource.damageType);
if (!var3 && this.initialInvulnerability > 0 && par1DamageSource != DamageSource.outOfWorld)
There is also a condition that checks if the server is dedicated, PVP is enabled, and damage is fall damage, in addition to damage not being void damage, but the first part clearly isn't what was intended as the condition will never be true in singleplayer (I'm not exactly sure what was intended here. According to MC-212 fall damage was fixed in multiplayer, which is indicated here - but why even have any of this code at all? At the most, I'd only make players invincible for a short time after they spawn for the first time (e.g. in case you spawn in a lava pool, which is rare but can happen).