So, here is the solution I used (Oracle WebLogic 12c, WELD 1.1.Final):
import org.jboss.weld.context.http.HttpConversationContext;
import javax.inject.Inject;
import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
@WebListener
public class SessionListener implements HttpSessionListener {
@Inject
private HttpConversationContext conversationContext;
@Override
public void sessionCreated(HttpSessionEvent httpSessionEvent) {
if (conversationContext != null) {
final long DEFAULT_TIMEOUT = 2 * 60 * 60 * 1000;
if (conversationContext.getDefaultTimeout() < DEFAULT_TIMEOUT){
conversationContext.setDefaultTimeout(DEFAULT_TIMEOUT);
}
}
}
@Override
public void sessionDestroyed(HttpSessionEvent httpSessionEvent) {}
}
Context is injected into the listener and the timeout is set when user starts the session.