CodeIgniter cookie domain domain

The following are the cookie settings for which cookies are used for the entire domain. For example, if I were on http://subdomain.domain.com , a cookie would be set for subdomain.domain.com, if I were on domain.com, a cookie would be for .com domain.

If a cookie is set for subdomain.domain.com, which means that subdomain2.domain.com cannot access the cookie from subdomain.domain.com?

/* |-------------------------------------------------------------------------- | Cookie Related Variables |-------------------------------------------------------------------------- | | 'cookie_prefix' = Set a prefix if you need to avoid collisions | 'cookie_domain' = Set to .your-domain.com for site-wide cookies | 'cookie_path' = Typically will be a forward slash | */ $config['cookie_prefix'] = ""; $config['cookie_domain'] = ""; $config['cookie_path'] = "/"; 
+6
source share
2 answers

Domain cookies depend only on this domain. Use ".domain.com" as the cookie domain to be able to use it in all subdomains and the main domain.

+9
source

When using multiple codeigniter applications on subdomains, it is also important to set the same $config['encryption_key'] .

-1
source

Source: https://habr.com/ru/post/886656/


All Articles