How do I end a session?

Call the Intercom shutdown method to clear your customers’ conversations when they log out of your app.

Ivan avatar
Written by Ivan
Updated over a week ago

You can install the Intercom Messenger on any public facing site that you own (your marketing site, your docs site, your developer hub, etc). In order to maintain continuity of conversations across all of these potentially different subdomains while your users are logged in, we set a cookie in your user’s browser. This cookie expires after one week.

Any user that uses a shared computer and browser with someone else will be able to see the most recently logged in user’s conversation history until the cookie expires. Because of this, it’s very important to properly shutdown Intercom when a user’s session on your app ends (via manually or automatically logging out). 

Here’s how to shutdown Intercom:

  1. You will have already begun tracking your user via the Intercom JS snippet or the “boot” method.

  2. When your user logs out of Intercom (or is automatically logged out by your app), call Intercom('shutdown');  from our JavaScript API, to end the Intercom session and clear the cookie.

  3. If applicable, call Intercom('boot', {app_id: 'YOUR_APP_ID'}) to start a fresh Intercom session.

The Intercom('shutdown');method will automatically reset Intercom to a clean state for logging in another user or booting Intercom for logged-out areas of your application.

Set a session duration

You can also specify a set time in your Intercom Messenger snippet using session_duration after which the session cookie will expire. Learn more about this in our developer docs.


Need more help? Get support from our Community Forum
Find answers and get help from Intercom Support and Community Experts

Did this answer your question?