We read in our documentation that "If no disk cache is configured (or cache.web_sessions.diskLimit is set to 0) a server restart will force all users to sign-out, and need to sign-in again after the restart, as the cache was unable to persist the session information. Enabling a disk cache is strongly recommended.", which is why we thought that disk cache might be disabled by default for web_sessions.
Here is a sanitized copy of our gerrit.config, hope it helps:
[core]
packedGitLimit = 16g
packedGitWindowSize = 16k
packedGitOpenFiles = 8192
[gerrit]
basePath = xxxxxx
canonicalWebUrl = xxxxxx
canonicalGitUrl = xxxxxx
reportBugUrl = xxxxxx
serverId = xxxxxx
ui = POLYGERRIT
enableGwtUi = true
enablePolyGerrit = true
[index]
type = lucene
threads = 17
[auth]
type = LDAP
gitBasicAuthPolicy = HTTP
autoUpdateAccountActiveStatus = true
[accountDeactivation]
startTime = Fri 22:00
interval = 1 week
[ldap]
server = xxxxxx
username = xxxxxx
accountBase = xxxxxx
groupBase = xxxxxx
guessRelevantGroups = false
[sendemail]
smtpServer = xxxxxx
connectTimeout = 2m
threadPoolSize = 4
[container]
user = gerritcr
javaHome = /usr/java/jdk1.8.0_172-amd64
heapLimit = 108g
[sshd]
threads = 128
listenAddress = *:29418
backend = NIO2
batchThreads = 16
commandStartThreads = 5
maxConnectionsPerUser = 48
idleTimeout = 0
waitTimeout = 600
[httpd]
listenUrl = proxy-http://*:8087/
maxThreads = 50
[cache]
directory = cache
[cache "diff"]
timeout = 600s
memoryLimit = 1g
diskLimit = 10g
[cache "diff_intraline"]
timeout = 600s
memoryLimit = 1g
diskLimit = 10g
[cache "diff_summary"]
timeout = 600s
memoryLimit = 1g
diskLimit = 10g
[cache "web_sessions"]
maxAge = 2d
memoryLimit = 16m
diskLimit = 256m
[rules]
reductionLimit =
2147483647 compileReductionLimit =
2147483647[gc]
startTime = Sat 12:00
interval = 1 week
[plugins]
allowRemoteAdmin = true
[hooks]
syncHookTimeout = 605
[download]
scheme = ssh
scheme = anon_git
[repository "*"]
defaultSubmitType = FAST_FORWARD_ONLY
[commentlink "changeid"]
match = (I[0-9a-f]{8,40})
link = "#/q/$1"
[receive]
timeout = 600s
enableSignedPush = false
threadPoolSize = 48
changeUpdateThreads = 35
[changeCleanup]
abandonAfter = 1 months
startTime = Sat 01:00
interval = 1 week
[plugin "login-redirect"]
whitelist = /plugins/metrics-reporter-prometheus/
[plugin "metrics-reporter-prometheus"]
excludeMetrics = ^jgit/block_cache/cache_used_per_repository/.*
excludeMetrics = ^plugins/replication/latency_slower_than_threshold/900/.*