Hello,
I have a question about security in my code.
Basically, I have a site where user can authenticate (userid and password are stored in db) and then, if authentication goes through, I register an "auth" variable with 'true' value. Then on every page that can only be accessed by an authenticated user, I add to the top something like:
if((!session_is_registered('auth_var')) || ($auth_var==false))
{//illegal attempt to access the page
header("location: LoginForm.php");
}
Another important point is that at this time I store all files (with or without authentication check) in the same directory because there aren't many of them.
So, questions are as follows:
1.) Can a malicious user fool PHP4 and get access to the "protected" files without authenticating?
2.) Is it an issue storing both auth and non-auth needed files in the same directory? (OS=Linux)
Any ideas or suggested readings are appreciated!
Thanks!