I understand pretty well how to protect php files with password using sessions (i.e. to create area which is only accessible after entering username and password). So I will need to replace html files that need to be protected with php files. But php files are usually more resource consuming.

So maybe it is possible to protect html files by password without changing them to php? I.e. when user enters information, it is processed by php file, but after user enters password-protected area all files should be htmls. Is it possible?