I'm running Firefox 61.0 on Arch Linux. When viewing the source of a page, I frequently (but not always, estimated 20% of the time) see the source code of the login page when I'm browsing a website that requires me to log in. This happens when I'm browsing localhost. The source code of each page is generated on the server, this is not a problem with the DOM being manipulated. It happens using Django as well as PHP. Example:
LOGIN PAGE:
<html>
<title>Login</title>
<body>
Login please: [ ]
</body>
</html>
HOME PAGE:
<html>
<title>Welcome USER NAME</title>
<body>
Good day, USER
</body>
</html>
After I have logged in and I am on the homepage, I hit CTRL+U, it will show me:
<html>
<title>Login</title>
<body>
You are logged in as USER
</body>
</html>
In other words, it isn't taking the previous page from its cache; it seems to somehow try and fetch the source code of the page I'm on but it is redirected to the login page.
NOTE: if I run INSPECT ELEMENT on the page then I do see the right source code. The problem is only with VIEW SOURCE. This does NOT happen in Chrome or other browsers, just in Firefox.
Any idea why this could happen?
To clarify: these are two different pages. The login page is login.php and the home page is index.php. When I CTRL+U on index.php, Firefox shows me the source code of login.php, even though I am already logged in.