Are you back? Your village needs you! Let's play!
If you are inactive for a period of time, the game will automatically log you out (which will make you vulnerable to attack). You must then click the prompt on screen to log back into your game session and be invulnerable from Multiplayer attacks.
This is to stop people from cheating the system by keeping their device on (when not actively playing), and remaining safe from attack.