title: Can't set cookie in yii2
body: <p>When i try to read the cookie getting null.</p>
  
  <p>CODE:</p>
  
  <pre><code>$date = new \DateTime();
  Yii::$app-&gt;response-&gt;cookies-&gt;add(new \yii\web\Cookie([
      'name' =&gt; $this-&gt;post_id,
      'value' =&gt; $date,
      'expire' =&gt; time() + 3600*12,
      'path' =&gt; '/post/view/?id=' . $this-&gt;post_id,
      'domain' =&gt; '.eshop.loc',
  ])); 
  
  $this-&gt;response['cookie'] = Yii::$app-&gt;request-&gt;cookies-&gt;getValue($this-&gt;post_id);
  </code></pre>
  
  <p>Tell me please where is the problem?</p>