I use same header for all pages, which include:
- user authentication code,
- logo & main menu html,
- login information (username, logout button / login-register buttons when not logged in).
Now to the question.
How to check if pages are public (accessible for non-registered users) or not? I usually redirected the non-registered users to login page, but how to handle it when some pages are public and some are not? I obviously cant use header since it is page independent. Is putting the public condition to every single page a good idea?