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>