code: function Session() {
      var self = this;
  
      if (instance) {
        return instance;
      }
      instance = this;
  
      this.wallets = [];
  
      return getSession().then(function(response) {
        // Assign the session data to ourself.
        lodash.assign(self, response.data);
  
        switch (self.plugin.header.kind) {
          case 'applet': self.plugin = new Applet(self.plugin, self.id); break;
          case 'servlet': self.plugin = new Servlet(self.plugin, self.id); break;
        };
  
        $rootScope.$emit('Local/Initialized', 'session');
        return self;
      
      }).catch(function(error) {
        throw new ApiError(error);
  
      });
  
      // Get our session data.
      function getSession() {
        var request = {
         method: 'GET',
         url: '/session/' + apiHelpers.sessionId()
        };
  
        return new ApiMessage(request).send();
      };
    }
docs: Constructor.
  @return {Object} The single instance of Session.
  @constructor