How do I set page states? (User logged in show this)

Is there not a way to do this globally for the entire page?

Reason I ask - I saw this thread