So I will have a few public pages and many private pages on my website.
After a user has successfully logged-on, I will store a few sessions variables and give him a new menu with access to the private pages. After logging out, the user’s session will be destroyed and the menu will change back to the default. Now the user must not be able to access any private pages, not even by typing the url. The only way to get back to private pages must be to logon again.
I know I can check on each and every page if the session is not set, redirect to home page.
Is there any better way to do this?
I might end up with 60 private pages and don’t really want to go and validate session data on each page.