Hello,
I’m trying to setup yii2 on shared hosting environment using apache. I’m using yii 2.0.3 and advanced template.
What I can’t get to work is to separate sessions and cookies as described in the documentation tutorial, I can’t post link, but if you do a search for “yii2 tutorial shared hosting” it will be on top. In the last part there is some code to add to backend/config/main.php but when I add it I can’t login to backend anymore getting following error:
And here is the code I add:
'components' => [
'request' => [
'csrfParam' => '_backendCSRF',
'csrfCookie' => [
'httpOnly' => true,
'path' => '/admin',
],
],
'user' => [
'identityCookie' => [
'name' => '_backendIdentity',
'path' => '/admin',
'httpOnly' => true,
],
],
'session' => [
'name' => 'BACKENDSESSID',
'cookieParams' => [
'path' => '/admin',
],
],
],
So what I’m doing wrong here and how can I fix it? Let me know if you need additional info.
Thanks in advance.