pkk
pkk

Reputation: 353

Cakephp3.x Sessions across sub domains

I know this type of question has been posted here but i want the solution for this in cakephp3.x. I have multiple sub domains and I'm trying to use the sessions across sub domains.

 http://example.com
 http://xyz.example.com
 http://abc.example.com

From other stack-overflow article i come know that i have set the cookie domain as below

session.cookie_domain = ".example.com"

But i don't find a way where and how to to set this in cakpehp3.x

Upvotes: 1

Views: 93

Answers (1)

pkk
pkk

Reputation: 353

First of all thank you @ndm for your solution. I have to put this code inside bootstrap.php

Configure::write('Session', [
    'defaults' => 'php',
    'ini' => [
        'session.cookie_path' => '/',
        'session.cookie_domain' => '.yourdomain.com'
    ]
]);

And its working for me now.

Upvotes: 1

Related Questions