When authenticating via a webpage using AJAX then closing the page it shows and then reauthenticating causes it to reuse the previous credentials. With the webpage - http://qt-labs.jp/test/login.html - do the following in the browser example:
1) Enter user1 to "User" and "Password" entry and click "login" button.
New Tab is created. And it shows "User: user1"
2) Close the opened tab
3) Edit "User" and "Password" entry to user2 and click "login" button again.
New Tab is created.