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.