Disable automatic session logout

Every couple of weeks I’m getting logged off from my personal, in-house hosted Gitlab instance, which I want to disable. I raised the “Session duration” setting to 1008000 (=700 days), but this does not seem to have any effect.

Is it possible to disable the automatic logoff completely? If not, where in the code is the expiration date set? I’d just remove that code from my installation.