title: Yii2 - Bad Request (#400) | Frontend and backend cookies
body: <p>The issue appears only when I open <code>frontend</code> and <code>backend</code> in the same <code>browser</code>. </p>
  
  <p><strong>Scenario:</strong></p>
  
  <blockquote>
    <p>Interact with Backend -> Switched Tab -> Interact with Frontend ->
    Switched Tab Back -> Interact with Backend -> Bad Request (#400)</p>
  </blockquote>
  
  <p><strong>Cookie Backend</strong></p>
  
  <pre><code>'identityCookie' =&gt; [
                  'name' =&gt; '_backendIdentity',
                  'path'=&gt;'/admin',
                  'httpOnly' =&gt; true,
              ],
  </code></pre>
  
  <p><strong>Cookie Frontend</strong></p>
  
  <pre><code>'identityCookie' =&gt; [
                      'name' =&gt; '_frontendIdentity',
                      'path'=&gt;'/', 
                      'httpOnly' =&gt; true,
                  ],
  </code></pre>
  
  <p><strong>Session Backend</strong></p>
  
  <pre><code>'session' =&gt; [
              'name' =&gt; 'session_backend'
          ],
  </code></pre>
  
  <p><strong>Session Frontend</strong></p>
  
  <pre><code>'session' =&gt; [
              'name' =&gt; 'session_frontend'
          ],
  </code></pre>