Documentation

get_cookie

CMain::get_cookie(
 string name, 
 mixed name_prefix = false
)

The method returns a cookie. Non-static method.

Parameters

ParameterDescription
name Name of the cookie variable.
name_prefix Prefix for the cookie name.
Optional parameter. By default - the value of the "Prefix name for cookies" parameter in the main module settings (this parameter value can be obtained via the method:
COption::GetOptionString("main", "cookie_name", "BITRIX_SM")

See Also

  • CMain::set_cookie
  • CMain::ShowSpreadCookieHTML

    Examples of use

    <?
    global $APPLICATION;
    $VISITOR_ID = $APPLICATION->get_cookie("VISITOR_ID");
    ?>


  • © «Bitrix24», 2001-2024