/** * Gets an instance of a Module session object. * * This static method retrieves the session object for a Module. * * Normally there's no need to manually call this method, since Module sessions * are transparently handled by the Module server. * * @since 5.1 * @param ModuleLocator $locator Module locator object. * @return ModuleObject The Module object. */ public static function getSessionModule(ModuleLocator $locator, $sessionId) { $context = new ModuleContext($locator->getLocation()); $session = new \Innomatic\Module\Session\ModuleSession($context, $sessionId); return $session->retrieve(); }