It’s quite annoying that every time page goes to login page when we try to refresh a page or saving a product in Magento 2 admin side. So this can be achieved by changing the admin session timeout in Magento 2.
- Log in to Magento 2 admin side using your credentials
- From the left side bar got to Stores > Settings > Configuration > Advanced > Admin > Security
- Search for field Admin Session Lifetime (seconds), the default value will be 900 seconds, and change this value to your desired value