Since phpBB 3.2.3, the links Privacy and Terms were added in the footer.
When you go to these pages, there is a link "Back to previous page", which redirects to the login screen (if you are not online) or to the index (if you've already been logged).
Because you can now reach the privacy and terms page from anywhere, the 'previous' page is not necessary the index or the logon screen.
As a guest, you'll go to the login screen if you click on this link, regardless the actual previous page. As a logged user, you'll go to the index, regardless the actual previous page.
So, you should either rename the link "go to login screen" or "go to the index" instead of "back to previous page", or change the behavior to the "back to previous page" so that an user will go back to the actual previous page (by php or javascript). A third solution is simply remove the link, which is not very important.