We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Weird cookie problem?

hey

    <?= var_dump("dark"); ?>                                                             #=> string(4) "dark"
    <?= var_dump($this->cookies->get('theme')->getValue()); ?>                           #=> string(32) "dark"
    <?= var_dump($this->cookies->get('theme')->getValue() == 'dark'); ?>                 #=> bool(false)

Why the hell does var_dump($this->cookies->get('theme')->getValue()); return a string "dark" with a length of 32?

Try:

    <? var_dump(htmlentities($this->cookies->get('theme')->getValue())); ?>