Welcome Guest, Not a member yet? Register   Sign In
Cookie set to current path, not entire site
#1

[eluser]Bryan Zera[/eluser]
I run the following set_cookie call from /auth/login on my site:
Code:
$domain = '.' . preg_replace("/^www\./", "", $_SERVER['HTTP_HOST']);
            
$cookie = array(
    'name'   => $this->cookie_name,
    'value'  => $username . '|' . md5($password),
    'expire' => 60*60*24*30,
    'domain' => $domain,
    'path' => '/'
);
            
set_cookie($cookie);

But when I try to read the code from /admin, it doesn't work. Am I incorrect in remembering that you can set cookies for an entire domain from a path within the domain?




Theme © iAndrew 2016 - Forum software by © MyBB