Though I have not yet checked your code, from the comment I can say that the browser works as expected.
Browser will have two clients (authenticator and an unregistered client) and when you load the page twice I assume that there are 2 more clients which takes the count to a total of 4 clients. No more clients can connect from the IP. When you restart the browser, the clients get destroyed and starts fresh.
The work around will be to free the client object on page unload. I will also check your webpage code to confirm