Moved escape mechanism to a central location in serversessionhandler.