if(sessionEntry.validUntil < now.getTime()) {
sessions.remove(sidCandidate);
sidCandidate = null;
} else {
sessionEntry.validUntil = now.getTime() + sessionTimeout*1000;
outputCookies.add(new RCCookie("sid", sessionEntry.sid, (int) (sessionTimeout), address.toString(), "/"));
}
permParams = sessionEntry.map;
} else {
Date now = new Date();
sessionEntry = new SessionMapEntry(sidCandidate, now.getTime() + sessionTimeout*1000, new ConcurrentHashMap<String, String>());
sessions.put(sidCandidate, sessionEntry);
permParams = sessionEntry.map;
outputCookies.add(new RCCookie("sid", sessionEntry.sid, (int) (sessionTimeout), address.toString(), "/"));
}
}
if( sidCandidate == null ) {
StringBuilder sb = new StringBuilder(20);
for (int i = 0; i < 20; i++) {
sb.append((char)(sessionRandom.nextInt(26) + 65));
}
SID = sb.toString();
Date now = new Date();
SessionMapEntry sessionEntry = new SessionMapEntry(SID, now.getTime() + sessionTimeout*1000, new ConcurrentHashMap<String, String>());
sessions.put(SID, sessionEntry);
outputCookies.add(new RCCookie("sid", sessionEntry.sid, (int) (sessionTimeout), address.toString(), "/"));
permParams = sessionEntry.map;
}
return;
}