php - Cookie less subdomain -
i have website
example.com
and cname subdomain
static.example.com
for css/js/img files, load without cookies in header
im using codeigniter set cookies, config.php
$config['cookie_domain'] = "example.com"; //not .example.com
but when im open google chrome console says cookies set .example.com
is okey? mean cookies set subdomains anyway?
im using codeigniter built-in cookies, im loading autoloader helper.
and setting cookies that
$cookie = array( 'name' => 'lang', 'value' => $lang, 'expire' => '86500', 'path' => '/', 'secure' => false ); set_cookie($cookie);
yes, should fine. initial .
on domain means cookie applies domain , subdomains. if cookie domain example.com
, wouldn't apply static.example.com
. see what dot prefix in cookie domain mean?
Comments
Post a Comment