You can control session time outs in sync with Salesforce. When set up, the session ends automatically for a user when the system is idle for the specified amount of time. The user is logged out and redirected to the login page. After you log back in to the application, a new access token is generated and you can continue from where you left.
For a guest user, a message appears stating that the session is expired. A fresh token is generated and you can start a new session from the home page.
To set up session time out for Customer Community User
Go to Setup, and in the Quick Find box, type Profiles.
Click Profiles.
Click Customer Community User.
Under the System section, click Session Settings.
Click Edit.
From Session Times Out After, select the desired time out value.
Click Save.
To set up session settings in Salesforce
Go to Setup, and in the Quick Find box, type Session Settings.
Click Session Settings.
Under the Session Timeout section, from Timeout Value, select the desired timeout value.
Click Save.
To set up session policies for connected apps
Go to Setup, and in the Quick Find box, type Connected Apps.
Click Connected Apps.
From the available list, click E-Commerce Getway.
Click Edit Policies.
Under the Session Polices section, from Timeout Value, select the desired timeout value.