exports = module.exports = function(IoC, connect, logger) {
  var uri = require('url');
  
  
  var promise = new Promise(function(resolve, reject) {
    var modules = IoC.components('http://i.bixbyjs.org/http/ISessionStore')
      , services = modules.map(function(m) { return m.a['@name']; });
    
    // TODO: Introspect container for session service types.
    //var type = 'sess-redis';
    //var type = 'sessions-mongodb';
    
    //var services = [ 'x-foo' ];
    
    connect(services, function(err, conn) {
      if (err) { reject(err); }
      resolve(conn);
    });
  });
  
  return promise
    .catch(function(err) {
      if (err.code !== 'ENOTFOUND') { throw err; }
      if (process.env.NODE_ENV !== 'development') {
        // TODO: Consider using a cookie-based store here, for stateless sessions
        //throw err;
        return null;
      }
      
      logger.notice('Using in-memory HTTP session store for development');
      return IoC.create('./store/memory');
    });
};

exports['@singleton'] = true;
exports['@require'] = [
  '!container',
  'http://i.bixbyjs.org/ns/connect',
  'http://i.bixbyjs.org/Logger'
];

@@ -37,17 +37,8 @@
 IoC,
- connect,
  log
@@ -50,128 +50,28 @@
 %7B%0A  
-var uri = require('url');%0A  %0A  %0A  var promise = new Promise(function(resolve, reject) %7B%0A    var modules = IoC.components
+%0A  return IoC.create
 ('ht
@@ -94,17 +94,16 @@
 rg/http/
-I
 SessionS
@@ -117,416 +117,70 @@
     
-  , services = modules.map(function(m) %7B return m.a%5B'@name'%5D; %7D);%0A    %0A    // TODO: Introspect container for session service types.%0A    //var type = 'sess-redis';%0A    //var type = 'sessions-mongodb';%0A    %0A    //var services = %5B 'x-foo' %5D;%0A    %0A    connect(services, function(err, conn) %7B%0A      if (err) %7B reject
+.catch(function(err) %7B%0A      console.log
 (err);
- %7D
 %0A      
-resolve(conn);%0A    %7D);%0A  %7D);%0A  %0A  return promise%0A    .catch(function(err) %7B
 %0A      
+//
 if (
@@ -615,45 +615,8 @@
 r',%0A
-  'http://i.bixbyjs.org/ns/connect',%0A
   'h

Simplify creation of session store.