0

I try create a cookie and then test it via this code:

define('COOKIE_ID', 'id');
define('COOKIE_EXPIRE', 0);
define('COOKIE_PATH', '');
define('DOMAIN', 'localhost');
define('COOKIE_SSL', false);
define('COOKIE_HTTPONLY', true);

public function SetCookieLive($name = COOKIE_VALUE, $value= null, $expire = COOKIE_EXPIRE, $path = COOKIE_PATH, $domain= DOMAIN, $secure=COOKIE_SSL, $httponly= COOKIE_HTTPONLY) 
    { 
    setcookie(COOKIE_ID, '123', $expire, $path, $domain, $secure, $httponly);
    if(isset($_COOKIE[COOKIE_ID]))
     return true;   
        else 
     return false;
}

but it return me flase always...

I tested it with a simple cookie and it works. but what is wrong with this function?

partiz
  • 1,206
  • 2
  • 13
  • 34

0 Answers0