Hello,
I found some issues when using phalcon cookies. Il try to make it simple as possible:
$a = 5;
if(!$a < 3)
{
$setcookie = $this->cookies->set("type:$car", "$brand", time() + 60);
}
$getcookie = $this->cookies->get("type:$car");
var_dump($getcookie);
die();
For some reason setting cookie inside if statement dosent set value of cookie.
protected '_filter' => null
protected '_name' => string 'type:sport-car' (length=14)
protected '_value' => null
protected '_expire' => int 0
protected '_path' => string '/' (length=1)
protected '_domain' => null
protected '_secure' => null
protected '_httpOnly' => boolean true
But when I pull out $setcooike from if statement, it works very well:
$a = 5;
$setcookie = $this->cookies->set("type:$car", "$brand", time() + 60);
if(!$a < 3)
{
}
$getcookie = $this->cookies->get("type:$car");
var_dump($getcookie);
die();
Vardump:
protected '_filter' => null
protected '_name' => string 'type:sport-car' (length=14)
protected '_value' => string 'BMW' (length=3)
protected '_expire' => int 1471253476
protected '_path' => string '/' (length=1)
protected '_domain' => null
protected '_secure' => null
protected '_httpOnly' => boolean true
Does any1 had same problems? Im using PHP 5.6 with Phalcon 2.0.13