A friend of mine recently asserted that it is unsafe to reuse the same tab in a browser for different websites. In other words, if the user:
Visits a sensitive website (for example logs in his bank account),
Goes to the address bar while the sensitive website is still opened,
Enters an URI of a different website which appears to be hacked,
then his bank account can be compromised. On the other hand, if the user:
Visits a sensitive website (for example logs in his bank account),
Closes the tab,
Opens a new tab,
Enters an URI of a different website which appears to be hacked,
then he's safer than in the first case.
The person asserting this couldn't explain concretely why is the second approach safer or show an example of such attack. He guesses that “is has something to do with memory management, in the second case, the memory being safely cleared”.
Without knowing the internals of browsers, this still seems weird to me. If there was a risk, I would expect it to be related to the browser's history (could the hacker's website benefit from accessing the history of my visit of the banking website?) and not memory management per se.
Is there an actual risk? Should I close tabs while going from a sensitive website to any other website?