Check session variable before delivering cached page

>all I need to do is execute this before the page is loaded from cache

Any page of site?

If you can specify what exactly page/pages you want to hide - I can help you with solution.

Related this login to 3rd part service, should customer do this login all the time? Maybe if client logged in once you can store this info and show this/these pages in future without login?