0
DOUBT 1
On my site I have PHP pages that register/login users, products, and other things, which I call through ajax. Have some way to not allow people to access these pages via URL?
Example: meusite.com/connection/cadastre.php
DOUBT 2 | Related to the first
To block access to restricted areas of the site I am using:
if(!isset($_SESSION['user_logado'])){
header("Location: index.php");
exit;
}
That’s the best way?
If it’s not the best, it can be considered safe?
It could use this method for protection of pages cited in DOUBT 1?
Wouldn’t there be any conflict with ajax? since the person would still not be logged in
DOUBT 3
I’m not as experienced in PHP as I’d like, so excuse me for ignorance, as far as I know, the PHP content of a page is not available for users to see, such as connection to BD, login and registration and others, but I believe that this access is possible by brute force. Can I rely on PHP’s own security or would it be necessary to make an additional security? As consulted in the first two questions.