Как сгруппировать ключевые запросы с помощью кластеризации?

API

This creates a cookie jar corresponding to the current request and response, additionally passing an object options.

A Boolean can optionally be passed as options.secure to explicitally specify if the connection is secure, rather than this module examining request.

Note that since this only saves parameters without any other processing, it is very lightweight. Cookies are only parsed on demand when they are accessed.

This adds cookie support as a Connect middleware layer for use in Express apps, allowing inbound cookies to be read using and outbound cookies to be set using .

This extracts the cookie with the given name from the header in the request. If such a cookie exists, its value is returned. Otherwise, nothing is returned.

can optionally be passed as the second parameter options. In this case, a signature cookie (a cookie of same name ending with the suffix appended) is fetched. If no such cookie exists, nothing is returned.

  • If the signature cookie hash matches the first key, the original cookie value is returned.
  • If the signature cookie hash matches any other key, the original cookie value is returned AND an outbound header is set to update the signature cookie’s value to the hash of the first key. This enables automatic freshening of signature cookies that have become stale due to key rotation.
  • If the signature cookie hash does not match any key, nothing is returned, and an outbound header with an expired date is used to delete the cookie.

This sets the given cookie in the response and returns the current context to allow chaining.

If the value is omitted, an outbound header with an expired date is used to delete the cookie.

If the options object is provided, it will be used to generate the outbound cookie header as follows:

  • : a number representing the milliseconds from for expiry
  • : a object indicating the cookie’s expiration date (expires at the end of session by default).
  • : a string indicating the path of the cookie ( by default).
  • : a string indicating the domain of the cookie (no default).
  • : a boolean indicating whether the cookie is only to be sent over HTTP(S), and not made available to client JavaScript ( by default).
  • : a boolean or string indicating whether the cookie is a «same site» cookie ( by default). This can be set to , , or (which maps to ).
  • : a boolean indicating whether to overwrite previously set cookies of the same name ( by default). If this is true, all cookies set during the same request with the same name (regardless of path or domain) are filtered out of the Set-Cookie header when setting this cookie.

To send a secure cookie, you set a cookie with the option.

HTTPS is necessary for secure cookies. When is called with and a secure connection is not detected, the cookie will not be set and an error will be thrown.

This module will test each request to see if it’s secure by checking:

  • if the property of the request is set to , or
  • if the property of the request is set to .

If your server is running behind a proxy and you are using , you need to configure your server to read the request headers added by your proxy to determine whether the request is using a secure connection.

For more information about working behind proxies, consult the framework you are using:

If your Koa or Express server is properly configured, the property of the request will be set to match the protocol reported by the proxy in the header.

Usage

Download the latest version and include it within your page along with jQuery (1.7.4 or later).

script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.x.x/jquery.min.js">script>
script type="text/javascript" src="jquery.ihavecookies.min.js">script>

Then initialise the plugin using:

// With the default options
$('body').ihavecookies();

// Or with customised options
var options = {
    title ...
}
$('body').ihavecookies(options);

This will append the cookie popup to the tag with the default settings and message.

Options

There are a number of options available to help with customisation:

Option Default Value Description
title «Cookies & Privacy» A custom title for the popup
message «Cookies enable you to use shopping carts and to personalize your experience on our sites, tell us which parts of our websites people have visited, help us measure the effectiveness of ads and web searches, and give us insights into user behavior so we can improve our communications and products.» Add your own cookie message here, if you prefer not to use the default one. HTML can be included within this message.
link «/privacy-policy» Link to your privacy policy for more information
delay 2000 Time before the popup is displayed after page load (in milliseconds)
expires 30 Days for the cookie to expire
onAccept function(){} Optional callback function when ‘Accept’ button is clicked
uncheckBoxes false Unchecks all checkboxes on page load that have class .ihavecookies applied to them. Set to true to turn this option on
moreInfoLabel ‘More information’ Label for link to privacy policy
acceptBtnLabel ‘Accept All Cookies’ Label for accept cookies button
advancedBtnLabel ‘Customise Cookies’ Label for customise cookies button
cookieTypesTitle ‘Select cookies to accept’ Title for customise cookies section
fixedCookieTypeLabel ‘Necessary’ Label for the «necessary» cookie type
fixedCookieTypeDesc ‘These are cookies that are essential for the website to work correctly.’ Description for the «necessary» cookie type
cookieTypes Array Array of cookie types for which to show checkboxes for — See code example below.

Events

Reopening the message

Use to reopen ihavecookies when clicking on an element. This opens the message with the previously selected checkboxes ticked.

$('button').click(function(){
    $('body').ihavecookies(options, 'reinit');
});

Example Code

The code below shows an example of the cookie types options.

$('body').ihavecookies({
    // Optional callback function when 'Accept' button is clicked
    onAccept function() {
        // Do whatever you need to here...
    },

    // Array of cookie types for which to show checkboxes.
    // - type: Type of cookie. This is also the label that is displayed.
    // - value: Value of the checkbox so it can be easily identified in
    //          your application.
    // - description: Description for this cookie type. Displayed in
    //                title attribute.
    cookieTypes ,
});

returns the value of the cookie.

returns if the the cookie type has been accepted, otherwise .

Styling

The plugin doesn’t include any CSS so it can be styled to fit in with your websites look and feel. The cookie message has an ID of . Sample CSS can be viewed in the accompanying file.

When the visitor accepts the message, the cookie with value is set along with cookie which contains an array of accepted cookie types e.g. . This will enable you to perform additional checks where necessary within your application (with regard to GDPR regulations).

Общие положения

Cookie-файлы (Куки) — небольшой фрагмент данных, отправленный веб-сервером и хранимый на цифровом устройстве пользователя — компьютере, ноутбуке, планшете, смартфоне и т.п. Веб-клиент (обычно веб-браузер) каждый раз при попытке открыть страницу соответствующего сайта пересылает этот фрагмент данных веб-серверу в составе HTTP-запроса. Cookie-файлы не позволяют идентифицировать личность.

Cookie-файлы используются в целях сбора статистических данных, которые позволяют определить, какие разделы сайта привлекают наибольшее внимание посетителей, а также в целях улучшения условий пользования сайтом посетителями. Пользователь может отказаться от использования Cookie-файлов, установив соответствующим образом настройки браузера согласно инструкциям, представленным ниже.
Блокировка cookie-файлов может повлиять на функциональные возможности сайта.. Продолжая использовать сайт без внесения изменений в настройки браузера, пользователь предоставляет согласие ООО «Городской супермаркет» на использование файлов cookie

Продолжая использовать сайт без внесения изменений в настройки браузера, пользователь предоставляет согласие ООО «Городской супермаркет» на использование файлов cookie.

Категории куки-файлов

Имя куки-файла Описание Тип

bx_user_id

BITRIX_SM_DSC

BITRIX_SM_LAST_SETTINGS

BITRIX_SM_SOUND_LOGIN_PLAYED

BX_USER_ID

Эти куки устанавливает система управления сайтом, они необходимы для корректной работы остальных сервисов на сайте.

Тип 1

PHPSESSID

Эта кука обеспечивает механизм работы сессии.

Тип 1

arr_inp

arr_inp*

validate

Эти куки используются для корректной работы формы «Напишите нам».

Тип 1

REGION_URL

Устанавливается регион, в котором Вы находитесь, после согласия для дальнейшего перенаправления с домена tns-e.ru.

Тип 2

LS_SERVICE

Кука, которая хранит в себе последний авторизованный лицевой счёт, используется для подстановки данного лицевого счёта в поле «Лицевой счёт» в прочих сервисах на сайте.

Тип 2

DR_*

Кука, которая показывает факт подключение электронной квитанции для лицевого счёта указанного после «DR_».

Тип 2

arr_ls

Кука, которая хранит в себе связку данных о лицевом счёте и адресе, которые были введены в сервисе передачи показаний и оплаты. Используется для вывода подсказки в момент заполнения поля «Лицевой счёт».

Тип 2

ID

Факт прочтения

Тип 2

cookie_policy

Факт закрытия информационного блока о куках

Тип 2

fr

Используется Facebook для получения рекламных объявлений.

Тип 4

_ga

_gat

_gat_*

_gid

Устанавливает Google Analytics или Google Tags

для идентификации пользователей и сбора статистики.

Тип 3

IDE

Устанавливается Google для выбора рекламных объявлений и их показа.

Тип 3

_ym_isad

_ym_metrika_enabled

_ym_metrika_enabled_*

_ym_mp2_substs_*

_ym_uid

_ym_visorc_*

metrika_enabled

device_id

i

mda

yandexuid

yp

ys

yabs-sid

Устанавливает Яндекс.Метрика для идентификации пользователей и сбора статистики.

Тип 3

abp

remixabp

remixcurr_audio

remixdt

remixflash

remixgp

remixlang

remixmdevice

remixrefkey

remixscreen_depth

remixsid

remixstid

remixsts

remixttpid

remixvkcom

trm_detect

Устанавливает Vk Pixel.

Тип 3

megagroup_onicon_*_site_domain

megagroup_onicon_*_user_hash

megagroup_onicon_*_user_id

Используются в платёжном сервисе А3.

Тип 4

42twp1

access_token

advURL

apiUrl

c8f2rg

chief_id

environment

fpusei

id

it-marketing-referrer

utm_source

it-io

it_uid

Устанавливает сервис LiveTex для функционирования чата онлайн

Тип 2

Тип 4

Что такое куки-файлы и зачем они нужны?

ПАО ГК «ТНС энерго» (г. Москва) и ПАО «ТНС энерго Ярославль» используют куки-файлы и похожие технологии, например, веб-хранилище HTML5 или локальные совместно используемые объекты (далее: «куки-файлы») для определения предпочтений пользователей и оптимальной организации веб-сайтов. Они облегчают навигацию и делают посещение сайта более удобным.

Куки представляют собой небольшие файлы, которые сохраняются на Вашем устройстве. Они используются для идентификации Вашего устройства при повторном входе на наши веб-сайты. При этом используются только сохраненные на Вашем устройстве куки-файлы. Персональные данные сохраняются в куки-файлах только с Вашего согласия.

General tips

Checking out the following resources usually solves most of the problems people seem to have with this cookie service:

The following general steps are usually very helpful when debugging problems with this cookie service or cookies in general:

  • check out if there are any open or closed issues that answer your question
  • check out the actual value(s) of
  • does it work if you use manually (i.e. in a console of your choice)?
  • set explicit paths for your cookies

I am always getting a «token missing» or «no provider» error.

Package managers are a well known source of frustration. If you have «token missing» or «no provider» errors, a simple re-installation of your node modules might suffice:

Converters

Read

Create a new instance of the api that overrides the default decoding implementation. All get methods that rely in a proper decoding to work, such as and , will run the given converter for each cookie. The returned value will be used as the cookie value.

Example from reading one of the cookies that can only be decoded using the function:

document.cookie = 'escaped=%u5317'
document.cookie = 'default=%E5%8C%97'
var cookies = Cookies.withConverter({
  read function (value, name) {
    if (name === 'escaped') {
      return unescape(value)
    }
    // Fall back to default for all other cookies
    return Cookies.converter.read(value, name)
  }
})
cookies.get('escaped') // 北
cookies.get('default') // 北
cookies.get() // { escaped: '北', default: '北' }

Write

Create a new instance of the api that overrides the default encoding implementation:

Cookies.withConverter({
  write function (value, name) {
    return value.toUpperCase()
  }
})

Basic Usage

Create a cookie, valid across the entire site:

Cookies.set('name', 'value')

Create a cookie that expires 7 days from now, valid across the entire site:

Cookies.set('name', 'value', { expires 7 })

Create an expiring cookie, valid to the path of the current page:

Cookies.set('name', 'value', { expires 7, path '' })

Read cookie:

Cookies.get('name') // => 'value'
Cookies.get('nothing') // => undefined

Read all visible cookies:

Cookies.get() // => { name: 'value' }

Note: It is not possible to read a particular cookie by passing one of the cookie attributes (which may or may not
have been used when writing the cookie in question):

Cookies.get('foo', { domain 'sub.example.com' }) // `domain` won't have any effect...!

The cookie with the name will only be available on if it’s visible from where the
code is called; the domain and/or path attribute will not have an effect when reading.

Delete cookie:

Cookies.remove('name')

Delete a cookie valid to the path of the current page:

Cookies.set('name', 'value', { path '' })
Cookies.remove('name') // fail!
Cookies.remove('name', { path '' }) // removed!

IMPORTANT! When deleting a cookie and you’re not relying on the , you must pass the exact same path and domain attributes that were used to set the cookie:

Cookies.remove('name', { path '', domain '.yourdomain.com' })

Note: Removing a nonexistent cookie neither raises any exception nor returns any value.

Do you support Angular Universal?

There is an issue for that. Check out for more information about future support.

Opening issues

Please make sure to check out our FAQ before you open a new issue. Also, try to give us as much information as you can when you open an issue. Maybe you can even supply a test environment or test cases, if necessary?

Contributing

We are happy to accept pull requests or test cases for things that do not work. Feel free to submit one of those.

However, we will only accept pull requests that pass all tests and include some new ones (as long as it makes sense to add them, of course).

Open a new pull request

Contributors

Thanks to all contributors:

  • paroe
  • CunningFatalist
  • kthy
  • JaredClemence
  • flakolefluk
  • mattbanks
  • DBaker85
  • mattlewis92
  • IceBreakerG

Yubico’s use of cookies, web beacons, and similar technologies

  1. Yubico’s use of cookies, web beacons, and similar technologies

    This section describes our use of cookies, web beacons and similar technologies. For further information on how the information we collect via cookies may be used and shared, please see our Privacy Notice.

    1. What are cookies and how do we use them?
      A cookie is a small text file that may be placed on your computer, mobile phone, or other device when you visit a website. A cookie enables recognition of your device and collection of information on what websites and functions that have been visited and used. It also helps to maintain your settings when you are navigating a website or return to the same website at a later point.

      We use both session cookies (which expire once you close your web browser) and persistent cookies (which stay on your device for a set period of time or until you delete them). Please see linked for a further description of the cookies.

      A web beacon is a small graphic image (also known as «pixel tag» or «clear GIF») that may be included on our sites, services, messaging, and tools, that typically work in conjunction with cookies to identify our users and user behavior.

      Similar technologies refer to technologies that store information in your browser or device utilizing locally shared objects or local storage and other web application software methods. These technologies can operate across all of your browsers, and in some instances may not be fully managed by your browser and may require management directly through your installed applications or device.

      We use the terms «cookies» generally in our notices to refer to all technologies that we may use to store data in your browser or device or that collect information or help us identify you in the manner described above.

    2. About your consent to the use of cookies

      When you visit a website, you have the right to receive certain information such as how cookies are used.
      Furthermore, you need to consent to our use of cookies. If you do not consent to the use of cookies, it may affect your user experience and you may not get full access to all features and functions on our website.

      In case you have given your consent to the use of cookies, you can easily withdraw your consent and choose to block and/or delete the cookies. For more information on how to block/erase cookies, please see below section «How to avoid cookies».

    3. Processing of personal data
      Some of our cookies may collect information that is personal data. We collect such information for the purpose of assessing the performance of our websites, services and tools, including as part of our analytic practices to help us understand how our visitors use our websites, determine if you have interacted with our messaging, determine whether you have viewed a link, or to improve our website content, services or tools.

      In some cases, the information collected by the cookies will only be used for statistical purposes and to improve our website. We will not be able to identify you through such information.

      For more information regarding how we use your personal data and for information regarding your rights, please see our privacy notice.

Cookies placed by third parties
Our website may contain content and sharing tools embedded from various social networks, such as Facebook, Twitter and LinkedIn. These networks/suppliers may use and place cookies on our website. We do not have access to, and cannot control, these cookies or the personal data and information that they may collect.

How to avoid cookies
Many web browsers allow you to manage your preferences regarding the use of cookies. You can set your browser to refuse cookies or delete certain cookies. You can find out more about cookies and how to delete and control them on www.aboutcookies.org or click help in your browser menu. If you have any questions or comments about our use of cookies, contact our customer support.

Please note that if you block our use of cookies, you may be unable to access certain areas of our website and features and functions may not work properly.

Last updated: May 24, 2018

Изменение настроек веб-браузера пользователя

При наличии желания удалить cookie-файлы, сохраненные на личном устройстве, и настроить свой веб-браузер так, чтобы отказаться от cookie-файлов, пользователь может сделать это в разделе настроек своего браузера.
В зависимости от используемого пользователем веб-браузера, для отключения cookie-файлов могут быть применены различные способы. Для получения более подробной информации, необходимо перейти по следующим ссылкам соответственно:

  • Microsoft Internet Explorer https://support.microsoft.com/ru-ru/gp/cookies
  • Google Chrome https://support.google.com/chrome/answer/95647?co=GENIE.Platform%3DDesktop&hl=ru
  • Safari https://support.apple.com/kb/PH19214?locale=fr_FR&viewlocale=ru_RU
  • Firefox https://support.mozilla.org/ru/kb/kuki-informaciya-kotoruyu-veb-sajty-hranyat-na-vas
  • Opera http://help.opera.com/Windows/10.20/en/cookies.html

При полном отключении cookie-файлов некоторые услуги не могут быть предоставлены пользователю, доступ ко всем разделам веб-сайта в данном случае возможен лишь в режиме ограниченного пользования.

Appendix: cookies, web beacons and other technologies on Yubico websites

Name Type of cookie, information collected by the cookie and the function of the cookie Retention period Domain name Disclosure of information to third parties
BIGipServer Used to distribute traffic to the website on several servers in order to optimize response times. Session yubico.com
PHPSessionID Preserves user session state across page requests. Session yubico.com
_ga Registers a unique ID that is used to generate statistical data on how the visitor uses the website. 26 months yubico.com Google (USA)
_gat Used by Google Analytics to throttle requests. 26 months yubico.com Google (USA)
x_gid Registers a unique IDE that is used to generate statistical data on how the visitor uses the website. 26 months yubico.com Google (USA)
_hjIncluded
InSample
This session cookie is set to let Hotjar know whether that visitor is included in the sample which is used to generate funnels. 365 days yubico.com HotJar (Malta)
ads/ga-audience
(pixel)
Used by Google AdWords to re-engage visitors that are likely to convert to customers based on the visitor’s online behavior across websites. Session google.com Google (USA)
(unnamed) (Unclassified) Session google.com HotJar (Malta)
admin-ajax.php-wc_cart_hash Keeps track of store cart state when updating contents. Session yubico.com
_hjCookieTest Helps analyze users’ web site and store behavior. Session yubico.com HotJar (Malta)
_hjRecording
Enabled
Helps analyze users’ web site and store behavior. Session yubico.com HotJar (Malta)
_mkto_trk Links visitor behavior to the recipient of an email marketing campaign to measure it. 2 years yubico.com Marketo (USA)
wc_
fragments
Keeps track of the user’s cart across a session. Session yubico.com
GENUINE_YK_VERIFICATION_CH Used to hold the challenge for the U2F/WebAuthn ceremony. Session yubico.com
demo_website_session Preserves user session state across page requests Session demo.yubico.com
cookie_notice_approved Used to store the user approval of cookie notice 1 year demo.yubico.com
webevents/
visitWebPage (pixel)
Created by Marketo to track traffic for webevents. Session mktoresp.com Marketo (USA)
collect (pixel) Used to send data to Google Analytics about the visitor’s device and behaviour. Tracks the visitor across devices and marketing channels. Session google-analytics.com Google (USA)
CONSENT Helps track cookie consent for Google. 236 Months google.com Google (USA)
(local storage) SessionID to associate the user with their web live chat session Persistent yubico.com Freshworks (USA)
(local storage) SessionID to associate the user with their web live chat session. Persistent wchat.freshchat
.com
Freshworks (USA)
(local storage) Local storage of user chat history. Persistent wchat.freshchat
.com
Freshworks (USA)

Что такое куки в браузере

Cookies (куки) — это специальные текстовые данные, которые сервер посещаемого сайта передает вашему браузеру в виде текстового файла, а тот, соответственно, сохраняет его в конкретной папке на вашем компьютере. Эти данные включают в себя: логин, пароль, индивидуальные настройки, состояние сеанса, статистика посещений и т.д. В дальнейшем, по этим данным, повторно посещаемый сайт сможет дать вам информацию именно по вашим предпочтениям.

Так, каждый раз, прежде чем браузер загрузит какой-либо сайт, он, в начале проверит есть ли к нему файл cookies, и если есть, то сперва отправит его на сервер для идентификации вас в качестве пользователя. Это покажет: зарегистрированы ли вы, есть ли у вас какие-либо особые настройки, привилегии или, например, доступ к каким-либо разделам и т.д.

Как это работает

Куки бывают разные по сроку действия. По умолчанию, они удаляются из браузера сразу после его закрытия, т.е. хранятся на протяжении всего одной сессии работы в интернете. Другие имеют свой срок действия, они удалятся только по его истечению или по запросу самого пользователя.

ParseJSON

By default cookie-universal will try to parse to JSON, however you can disable this
functionality in several ways:

Disable globally

// server
const parseJSON = false
app.get('/', (req, res) => {
  const cookies = require('cookie-universal')(req, res, parseJSON)
})

// browser, from import
import Cookie from 'cookie-universal'
const parseJSON = false
const cookies = Cookie(false, false, parseJSON)

Disable globally on the fly

// server
app.get('/', (req, res) => {
  const cookies = require('cookie-universal')(req, res)
  cookies.parseJSON = false
})

// browser, from import
import Cookie from 'cookie-universal'
const cookies = Cookie(false, false)
cookies.parseJSON = false

Disable on a specific get request

// server
app.get('/', (req, res) => {
  const cookies = require('cookie-universal')(req, res)
  cookies.set('cookie-name', 'cookie-value')
  cookies.get('cookie-name', { parseJSON false })
})

// browser, from import
import Cookie from 'cookie-universal'
const cookies = Cookie(false, false)
cookies.set('cookie-name', 'cookie-value')
cookies.get('cookie-name', { parseJSON false })
Ссылка на основную публикацию