If you don't want this behaviour, you can disable it with the closeOnUnload client option, which causes the client to send a close request to Ably in the window.beforeunload event. This will mean the connection state will not be retained, and any presence members associated with that connection will leave immediately.
Another option is to use the recover client option. This will cause the same connection to be resumed after a page refresh (it stores the recovery key in the browser's localStorage), so the same presence member stays the whole time - it isn't replaced by a new one. So in a sense this solves the problem in the opposite way: reusing the same connection, rather than promptly closing the old and starting a new. See an example of this here. Note that while this option solves the doubling up presence members after a refresh, if the user closes the tab, they will stick around in the presence set for 15 seconds (as the client library can not know if the beforeunload event is due to a refresh or a navigation / tab close).