- Session sess = null;
- synchronized(sessions) {
- if(sc != null)
- sess = sessions.get(sc.value);
- if(sess == null) {
- String id = newid();
- sess = create(req);
- sessions.put(id, sess);
- sc = new Cookie("jsvc-session", id);
- sc.expires = new Date(System.currentTimeMillis() + (86400L * 365L * 1000L));
- sc.path = req.ctx().sysconfig("jsvc.session.path", req.rooturl().getPath());
- String pd = req.ctx().sysconfig("jsvc.session.domain", null);
- if(pd != null)
- sc.domain = pd;
- sc.addto(req);
- }
+
+ if(sc != null)
+ sess = sessions.get(sc.value);
+ if(sess == null) {
+ sess = create(req, newid());
+ sessions.put(sess.id, sess);
+ sc = new Cookie("jsvc-session", sess.id);
+ sc.expires = new Date(System.currentTimeMillis() + (86400L * 365L * 1000L));
+ sc.path = req.ctx().sysconfig("jsvc.session.path", req.rooturl().getPath());
+ String pd = req.ctx().sysconfig("jsvc.session.domain", null);
+ if(pd != null)
+ sc.domain = pd;
+ sc.addto(req);