This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* ставим авторизованную сессионную куку для родительского | |
* домена, чтобы все поддомены ее видели | |
*/ | |
AddEventHandler('main','OnAfterUserAuthorize',function($arUser){ | |
$m = null; | |
if(preg_match('/^.+(\.mysite\.com)$/',$_SERVER['SERVER_NAME'],$m)) | |
setcookie(session_name(),session_id(),0,'/',$m[1]); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Bitrix\Main\Engine\Contract\Controllerable; | |
class ajaxTest extends \CBitrixComponent implements Controllerable { | |
function executeComponent(){ | |
$this->arResult = [ | |
'COMPONENT_ID' => $this->componentId() | |
,'SCRIPT_PATH' => $_SERVER['SCRIPT_NAME'] | |
]; |