uttam
uttam

Reputation: 589

Error in using common session for codeigniter driven subdomains

I have some codeigniter driven sub-domains and using native codeigniter session library. There is a sub-domain that creates and updates the session and other sub-domain has to share the session. I am not able to share the session among other sub-domains. I have changed the config parameter in application/config.php

$config['cookie_domain']    = "example.com";

but it's not working.

Upvotes: 2

Views: 1163

Answers (2)

Vishal
Vishal

Reputation: 1

I was facing the same problem.

Adding ".example.com" to cookie_domain didn't work for me. I was using different encryption keys ($config['encryption_key']) for both subdomains too.

When they were made the same, the session was then available across both subdomains.

Upvotes: 0

Yan Berk
Yan Berk

Reputation: 14428

Add a dot at the beginning: $config['cookie_domain'] = ".example.com";

Upvotes: 1

Related Questions