diff --git a/modules/gerrit/templates/gerrit.config.erb b/modules/gerrit/templates/gerrit.config.erb
index afcca23c21..a007a912fe 100644
--- a/modules/gerrit/templates/gerrit.config.erb
+++ b/modules/gerrit/templates/gerrit.config.erb
@@ -12,6 +12,7 @@
 [auth]
 	type = OPENID_SSO
 	openIdSsoUrl = <%= openidssourl %>
+	cookieSecure = true
 [sendemail]
 	smtpServer = localhost
 [container]
@@ -23,6 +24,8 @@
 	listenUrl = proxy-https://*:8081/
 [cache]
 	directory = cache
+[cache "web_sessions"]
+	maxAge = 1d
 [user]
 	email = <%= email %>
 <% commentlinks.each do |commentlink| -%>