public function setCookie($cookieName, $value = null, $expire = null) {
        if ($expire !== null) {
            $expire = time() + (60 * 60 * $expire);
        }

        if (setcookie($cookieName, $this->encodeCookie($value), $expire, "/")) {
            return true;
        } else {
            return false;
        }
    }
public function setCookie($cookieName, $value = null, $expire = null) {
        if ($expire !== null) {
            $expire = time() + (60 * 60 * $expire);
        }

        if (setcookie($cookieName, $this->encodeCookie($value), $expire, "/")) {
            return true;
        } else {
            return false;
        }
    }
public function setCookie ( $ cookieName , $ value = null , $ expire = null ) { if ( $ expire !== null ) { $ expire = time ( ) + ( 60 * 60 * $ expire ) ; } if ( setcookie ( $ cookieName , $ this -> encodeCookie ( $ value ) , $ expire , "/" ) ) { return true ; } else { return false ; } }
Sets a cookie in the user's browser

@param string $cookieName
@param string|null $value The value to store in the cookie
@param int|null $expire how many HOURS the cookie will be valid (set to 0 for session time)
@return bool
Sets a cookie in the user s browser