public static function factory($storage)
    {
        switch ($storage) {
            case 'apc':
                return new Storage\Apc(Cache::storage('apc'));

            case 'cookie':
                return new Storage\Cookie();

            case 'file':
                return new Storage\File(Config::get('session.storage_path'));

            case 'pdo':
                return new Storage\Pdo(Pdo\Factory::get(Config::get('session.database')));

            case 'memcached':
                return new Storage\Memcached(Cache::storage('memcached'));

            case 'memory':
                return new Storage\Memory();

            case 'redis':
                return new Storage\Redis(Cache::storage('redis'));

            case 'dba':
                return new Storage\Dba(Cache::storage('dba'));

            default:
                throw new \RuntimeException("Session storage [$storage] is not supported.");
        }
    }