diff --git a/src/session.ts b/src/session.ts index 11490bf..4428c51 100644 --- a/src/session.ts +++ b/src/session.ts @@ -89,6 +89,13 @@ export class Session { } refresh(): void { + // Attemp clean disconnection first + try { + this.provider.disconnect(); + this.provider.destroy(); + } catch (err) { + // Page will close so doesn't really matter much + } resetSession(); } }