Clear all history and session information

Hi

I have LC setup on my website (which is an authorized user only application). We have cases where a person can have more than 1 account and this is causing issues because when this user signs out and signs into their other account, the chat history and session persists. (I believe this is from the local storage and cookie).

Is there a good way to handle this? I want to delete everything on sign out. (Node.js application)

Hello @fathi.m ,
sorry for the late reply,

Visitor’s identity is stored in cookies and we don’t have an option to clear those from visitors browser. There are some options you can do to mitigate this however.
If you are using different groups for certain accounts, you can divide them by adding
window.__lc.chat_between_groups = false;
into the LiveChat tracking code. Each user will have unique identity for each group then and won’t share history between them.
Another option is disabling the Chat history in settings of LiveChat, this way once the chat is finished and the page reloaded, the history will no longer be visible for a visitor.
Last, but not least, a custom chat-widget can be created by using our Customer-SDK (https://developers.livechat.com/docs/extending-ui/extending-chat-widget/v2.0/customer-sdk/#header). This requires a development team on your side and a lot of work to build the widget from scratch, but would allow you to control visitors identity and fetch the history only for the currently logged in user.

hope it helps!