The issue appears only when I open frontend
and backend
in the same browser
.
Scenario:
Interact with Backend -> Switched Tab -> Interact with Frontend -> Switched Tab Back -> Interact with Backend -> Bad Request (#400)
Cookie Backend
'identityCookie' => [
'name' => '_backendIdentity',
'path'=>'/admin',
'httpOnly' => true,
],
Cookie Frontend
'identityCookie' => [
'name' => '_frontendIdentity',
'path'=>'/',
'httpOnly' => true,
],
Session Backend
'session' => [
'name' => 'session_backend'
],
Session Frontend
'session' => [
'name' => 'session_frontend'
],
Thanks to
@indra shastri
For those who are facing same issue:
Adding the following resolved my problem.
Backend config/main.php
Frontend config/main.php
It is the issue of
CSRF
that are different on the bothfrontend
andbackend
so when a browser storing thesession
of same application have 2 differentCSRF
then one of the application will getBad Request (#400)