Documentation

BX.setCookie

result_type
BX.setCookie(
 name,
 value,
 array options
);

Sets up a cookie.

Function parameters

Parameter Description
name Name
value Value (string)
options Keys
  • expires - main, indicated in seconds (the period after which the cookie record will be deleted). If any negative number is specified, the record will be deleted instantaneously.
  • path - path to the site domains for which this cookie record will be functioning.
  • secure - if passed true, the cookie will function only at the https site.

Examples of use

Setting up a cookie for 24 hours:

BX.setCookie('test', '123456', {expires: 86400});


© «Bitrix24», 2001-2022
Up