Check session variable before delivering cached page

>I want to have the whole page visible only to people who have „logged in“.

Is it some custom controller or?