I am in the process of making a secure Web application on a remote server. Is there a industry standard of preventing users from accessing web pages that are only available to users who have posted their login details.
So far authenticated user pages are protected using simple header redirects if the user do sent hold a session variable.
Is this industry standard? Are there better ways to implement such a method.
pysedo code
Session code dosent equal value or session is null {
header redirect to index
}
Like I said in my comment, redirect headers are not a security feature in their own. After you have sent a redirect header, you should make sure that normal execution can’t happen.
For example:
Even if the username and password are not correct, the contents of this page can still be accessed by just ignoring the
Locationheader.A simple fix would be:
Furthermore, it’s important that authentication doesn’t rely on manual checks on each page, because these checks can easily be forgotten by developers. Try to automate these kind of things as much as possible.