$config = [
'components' => [],
'modules' => [],
'on afterRequest' => function (Event $event) {
Yii::$app->response->cookie->add(new Cookie([
'name' => 'cookie_name',
'value' => 'cookie_value'
]));
}
];