Just wondering, if anyone can help.
So our customer experience issue, on scenario when the user on active webmessaging chat, close the browser/ tab, they expect to clear session/ history webmessaging if user re-open browser/tab webmessaging.
Is this the right solution, to clear session _{deploymentId}:gcmcopn _{deploymentId}:gcmcsessionActive
What Fransiska is asking here is how to clear the chat when the tab or browser is closed.
As I understand it, there is no reliable JS event of tab or browser close, as we dont want to close the chat session when navigating around the site, so onbeforeunload is not suitable.
As a workaround, I am setting my own sessionStorage item, and then checking if it's present onpageload. Obviously SessionStorage does not survive a tab close so if it isnt present, I delete all the Genesys LocalStorage items.
What we are asking is: Is this the best way to do it? Is there a way to send a Close Chat message to the chat server on tab close? Is there a way to use SessionStorage not LocalStorage to increase security? Do you have any other recommendations on how to implement this? It seems like it would be a common requirement to close a chat session when the browser is closed.
This is the same use case that we are having a problem, we clear the local storage on a Genesys event. I also wanted to know if there are other ways to implement this. We are using react server rendering and it is somewhat not satisfied with our workaround.
Good conversation.
Indeed, the challenge is that detecting browser/tab closed via JS event is unreliable, therefore we cannot productize this approach.
We have thought about using SessionStorage, somehow related to this Idea > Genesys Cloud Ideas Portal
The problem with SessionStorage is that if user opens another tab on the same browser/domain/deploymentId, it will basically start a new messaging session entirely, so not always ideal, but perhaps it may be sufficient for extreme privacy scenarios. Almost like handling/storing shopping-cart or user-preferences.
For now, we are planning to make the Guest Session configurable (default 72hours) and down to 15 mins: so after 15 mins of no messages, the session would just expire, and not accessible in any browser. See this Idea > Genesys Cloud Ideas Portal @willb described a good client-side workaround, to leverage SessionStorage.
As a reminder, whenever you need to clear Genesys Storage, please use our new Messenger.clear JS command to avoid future issues in case we change key storage values. https://developer.genesys.cloud/commdigital/digital/webmessaging/messengersdk/SDKCommandsEvents/messengerPlugin#messenger-clear