How to Clear a User Session on WebChat

You may want to clear a session if your users log into the same site on the same browser

Last Updated: May 3, 2022

What's in this article?

When Would You Clear a WebChat Session?

It is not necessary to clear user sessions unless your specific use case benefits from it. You may want to clear your users' session if you have a website or app where different users could log into the same site on the same browsers. For example, logging into a banking website to check a balance.


What Does Clearing a Session Do?

Clearing a session will clear all related cookies from the previous user's session. This means that the next person that logs in will have a fresh session and will have to reauthenticate (either manually or via SSO, depending on your configuration).

This will ensure that users don't accidentally log into a session of a different user.


Method to Clear a Session

The clear() method removes all stored user data and resets the WebConnect instance.

To use this, you can call: 

WebConnect.clear()


You'll likely want to call this when a user logs out to ensure the session remains active while the user is still logged in.

Help us improve. Was this article helpful?


Can't find what you're looking for? Submit an Article Request.