public function locate(HttpServletRequestInterface $servletRequest, array $args = array())
{
// load the servlet path => to locate the servlet
$servletPath = $servletRequest->getServletPath();
// check if we've a HTTP session-ID
$sessionId = null;
// if no session has already been load, initialize the session manager
if ($manager = $this->getApplication()->search('SessionManagerInterface')) {
$requestedSessionName = $manager->getSessionSettings()->getSessionName();
if ($servletRequest->hasCookie($requestedSessionName)) {
$sessionId = $servletRequest->getCookie($requestedSessionName)->getValue();
}
}
// return the instance
return $this->lookup($servletPath, $sessionId, $args);
}