code: public function getResponse($objPage)
  	{
  		// Set last page visited
  		if ($objPage->redirectBack)
  		{
  			$_SESSION['LAST_PAGE_VISITED'] = $this->getReferer();
  		}
  
  		$strLogoutUrl = System::getContainer()->get('security.logout_url_generator')->getLogoutUrl();
  		$strRedirect = Environment::get('base');
  
  		// Redirect to last page visited
  		if ($objPage->redirectBack && !empty($_SESSION['LAST_PAGE_VISITED']))
  		{
  			$strRedirect = $_SESSION['LAST_PAGE_VISITED'];
  		}
  
  		// Redirect to jumpTo page
  		elseif (($objTarget = $objPage->getRelated('jumpTo')) instanceof PageModel)
  		{
  			/** @var PageModel $objTarget */
  			$strRedirect = $objTarget->getAbsoluteUrl();
  		}
  
  		$uri = Http::createFromString($strLogoutUrl);
  
  		// Add the redirect= parameter to the logout URL
  		$query = new Query($uri->getQuery());
  		$query = $query->merge('redirect=' . $strRedirect);
  
  		return new RedirectResponse((string) $uri->withQuery((string) $query));
  	}
docs: Return a redirect response object
  
  @param PageModel $objPage
  
  @return RedirectResponse