*
* @see org.apache.cocoon.environment.Request#getSession(boolean)
*/
public Session getSession(boolean create) {
javax.servlet.http.HttpSession serverSession = this.req.getSession(create);
HttpSession session;
if (serverSession != null) {
synchronized (sessions) {
// retrieve existing wrapper
WeakReference ref = (WeakReference)sessions.get(serverSession);
if (ref == null || (session = (HttpSession)ref.get()) == null) {
// create new wrapper
session = new HttpSession(serverSession);
sessions.put(serverSession, new WeakReference(session));
}
}
} else {
// invalidate