/**
  * Initializes application shell. Called after initializeKernel.
  *
  * @param System\IApplicationStrategy $initStrategy
  */
 protected function initializeShell(\Bitrix\Main\System\IApplicationStrategy $initStrategy = null)
 {
     $this->authenticateUser();
     if ($initStrategy != null) {
         $initStrategy->authenticateUser();
     }
     define("BX_STARTED", true);
     // required for iblock to define site
     //magic parameters: show page creation time
     if ($_GET["show_page_exec_time"] == "Y" || $_GET["show_page_exec_time"] == "N") {
         $_SESSION["SESS_SHOW_TIME_EXEC"] = $_GET["show_page_exec_time"];
     }
     //magic parameters: show included file processing time
     if ($_GET["show_include_exec_time"] == "Y" || $_GET["show_include_exec_time"] == "N") {
         $_SESSION["SESS_SHOW_INCLUDE_TIME_EXEC"] = $_GET["show_include_exec_time"];
     }
     //magic parameters: show include areas
     if (isset($_GET["bitrix_include_areas"]) && $_GET["bitrix_include_areas"] != "") {
         $GLOBALS["APPLICATION"]->setShowIncludeAreas($_GET["bitrix_include_areas"] == "Y");
     }
     //magic sound
     /** @var $context HttpContext */
     $context = $this->context;
     $user = $context->getUser();
     /** @var $request HttpRequest */
     $request = $context->getRequest();
     if ($user->isAuthenticated() && $request->getCookie("SOUND_LOGIN_PLAYED") == null) {
         /** @var $response HttpResponse */
         $response = $context->getResponse();
         $response->addCookie(new \Bitrix\Main\Web\Cookie('SOUND_LOGIN_PLAYED', 'Y', 0));
     }
     $event = new Event("main", "OnBeforeProlog");
     $event->send();
     $this->authorizeUser();
     if ($initStrategy != null) {
         $initStrategy->authorizeUser();
     }
 }