public final class CacheBasedWebSession implements WebSession {
private static final String ACCOUNT_COOKIE = "GerritAccount";
static final long MAX_AGE_MINUTES = HOURS.toMinutes(12);
public static Module module() {
return new CacheModule() {
@Override
protected void configure() {
persist(WebSessionManager.CACHE_NAME, String.class, Val.class)
.maximumWeight(1024) // reasonable default for many sites
.expireAfterWrite(MAX_AGE_MINUTES, MINUTES) // expire sessions if they are inactive