Then it gets a bit complicated, since this would affect customers on private devices as well.
One idea that I think should work (haven't tested it myself yet) is if you have Conversation Disconnect enabled, you could check when the page loads if there is an ended chat with chat history, and if that's the case you could use clearSession to remove the information.
Ideally you would have the chat button hidden while you do this and show the button after it's cleared.
You would need to use different parts of the Messaging Javascript SDK
https://developer.genesys.cloud/commdigital/digital/webmessaging/messengersdk/
------------------------------
Jan Heinonen
Contact Center Specialist
GlobalConnect AB
------------------------------
Original Message:
Sent: 06-27-2025 09:06
From: Shiva Gupta
Subject: Web Messenger Chat History Persists Across Users – How to Clear on Browser Close
This explains the setting at the browser level. Unfortunately, we don't have control over the browser settings on public computers.
To address this, We are planning to implement a solution by attempting to detect browser close events using JavaScript.
------------------------------
Shiva Gupta
NA
Original Message:
Sent: 06-27-2025 03:40
From: Jan Heinonen
Subject: Web Messenger Chat History Persists Across Users – How to Clear on Browser Close
In most browser settings you can configure it to delete all data when it's closed.
For example for Chrome
https://support.google.com/chrome/community-guide/245444314/how-to-automatically-clear-browsing-data-when-closing-google-chrome-window-a-step-by-step-guide?hl=en
------------------------------
Jan Heinonen
Contact Center Specialist
GlobalConnect AB
Original Message:
Sent: 06-26-2025 09:38
From: Shiva Gupta
Subject: Web Messenger Chat History Persists Across Users – How to Clear on Browser Close
Thanks for the update!
Could you please provide the JavaScript to detect a browser close event?
------------------------------
Shiva Gupta
NA
Original Message:
Sent: 06-25-2025 15:35
From: Angelo Cicchitto
Subject: Web Messenger Chat History Persists Across Users – How to Clear on Browser Close
Trying to detect browser close via JavaScript is unreliable, unfortunately: this is a known limitation for all browsers.
We are building new feature to allow for customizable session expiration timeout > https://genesyscloud.ideas.aha.io/ideas/DXWMM-I-7
------------------------------
Angelo Cicchitto
Genesys - Employees
Original Message:
Sent: 06-25-2025 15:23
From: Shiva Gupta
Subject: Web Messenger Chat History Persists Across Users – How to Clear on Browser Close
Hi All,
We've implemented a basic Genesys Web Messenger on our client's website. We noticed the following behavior:
A user starts a conversation and then closes the browser without ending the chat session (the chat widget remains open).
After some time, When a different user visits the website on the same device/browser, they can see the entire previous chat history.
We want to ensure that the chat history is cleared when the browser is closed or a new user accesses the site.
Question:
Is there a recommended way to automatically delete or clear the Web Messenger chat session/history when the browser/tab is closed? Or is there a way to expire the session on browser close?
Any guidance or best practices would be appreciated.
Thanks in advance!
#DigitalChannels
------------------------------
Shiva Gupta
NA
------------------------------