Pieces of web applications such as WordPress or moodle require to specify the URL that the user will provide in order to visit the site. For example, in moodle has the
$CFG->wwwroot config parameter that takes the value of the website's/webapp's URL.
So I was wondering what benefit this approach offers into the web app's security. Also, I am developing a web application, so I was thinking what I achieve by adopting this mechanism into my web app instead of just not do any check at all.