Magento Open Source 2.1.x
Online Session Length

The length of each customer session is set by default to fifteen minutes. If there is no keyboard activity during that time, the current session ends, and customers must log back into their accounts to continue shopping. If Persistent Cart is enabled, the contents of their carts are saved for the next time they sign in to their accounts.

Online Customers Options

To configure the online session length:

1. On the Admin sidebar, tap Stores. Then under Settings, choose Online Now.
2. In the panel on the left under Customers, choose Customer Configuration.
3. Expand the Online Customers Options section.
4. In the Online Minutes Interval field, enter the number of minutes before the customer session. Leave the field empty to accept the default interval of fifteen minutes.
5. When complete, tap  Save Config .