Fixed an issue with Firefox sometimes breaking sessions on reload due to...

... socket disconnections.