Sounds like you just want a login filter, something to check if a user is logged in or not. A good way to do something like this is to have a MySQL table with a list of all users and their session id from when they logged in. As the session ID is only changed when the browser is closed, it will keep them logged in for a while. So when your visitors try to access the page, search the table you have created for their session id, if no results are found simply tell them to log in. Thats one way of doing it.