I'm redesigning a website and want to use WordPress for the content management system. The current site is written in PHP and has a small custom application built with PHP and MySQL, which provides a member to signup, login, place an order, and then logout. How do I incorporate the application into WordPress, since the content within the application is only available to someone who has logged in?

In the current site, I set a session variable on login, and test each application page to see if the session variable is set, before displaying the page.