I am currently wondering how a centralized page authenticator could be achieved. Can anyone suggest a neat algorithm for me? What I intend to achieve is to make my backend administrator pages session protected without writing a piece of session checking code to each of my pages that I want protected. I currently do something like this:
login page -> if right credentials : set session -> if view protected page without session : reject else : permit
Any best practices (or a better method) on/than this?