Folder restriction is normally accomplished through HTTP authentication. You can find a lot of information on this by searching the net (e.g. yahoo) using keywords like these:
http-authentication php script
Alternatively you can go to php scripts banks (hotscripts.com scriptsearch.com, etc) to get working scripts. This method is not ideal because it tends to remember the login, and never expires. Protecting each page using session is still a way to go, unless someone knows a way to protect folder using session.
Good luck,
Paul