It was a lot of questions how to share CI native sessions between subdomains or domain & subdomain.
Just some of them: 1, 2, 3
Everybody says that we should define $config['cookie_domain']
like this
$config['cookie_domain'] = ".example.com";
It seems to be correct answer, but... subdomain drops data on update (the value $config['sess_time_to_update'] = 300;
) on both domains. After the sess_time_to_update
is expired all data get droped.
Additional info:
- CodeIgniter ver. 2.1.4
- Subdomain & domain use the same files (alias).
- $config['sess_use_database'] = TRUE;