Original Message:
Sent: 10-08-2024 03:12
From: Angelo Cicchitto
Subject: Web Messenger - Clear conversation/History
Hello @Rui Tomás - please avoid clearing localStorage directly, but rather use our native Messenger command to clear the necessary browser storage entries, using Messenger.clear command: this is a safer approach, so that if we were to change storage location in future, we can guarantee backward compatibility. Additionally, this will limit clearing only Genesys related entries, without disrupting other localStorage variables that may be needed for your website.
------------------------------
Angelo Cicchitto
Genesys - Employees
Original Message:
Sent: 10-07-2024 10:25
From: Rui Tomás
Subject: Web Messenger - Clear conversation/History
Found a solution. Adding this script to the webpage:
<script>
// Function to clear local storage and specific cookies
function clearSessionData() {
// Clear local storage
localStorage.clear();
// Clear specific cookie
document.cookie = "messenger-session=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
}
// Call the function on page load to reset session data
window.onload = function() {
clearSessionData();
}
</script>
Original Message:
Sent: 10-07-2024 09:51
From: Rui Tomás
Subject: Web Messenger - Clear conversation/History
Hi!
We need to clear the session conversation/history every time we close the browser.
When we use the chat widget on public devices, we need to grant that the next user dont see the previous conversation.
I know that we have the "Clear Conversation" option on messenger cfg but we need an automatic way of do it in case the user forgot to use the bin icon.
Can we add some code to load script to force a new session without previous history?
How can this be done?
Thks in advanced!
#DigitalChannels