We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

set domain in Phalcon\Http\Response\Cookies::set

set method in Phalcon\Http\Response\Cookies::set doesn't have arguments for setting the domain. I need to set it to ".mydomain" in order to allow the cookie to be valid accross subdomain. Please anybody who knows, tell to me how?


@jeffreycahyono, the method has this option: Check the arameters:

set (string $name, [mixed $value], [int $expire], [string $path], [boolean $secure], [string $domain], [boolean $httpOnly])

Ooops there is! Don't know why it didn't show in my autocomplete. maybe I'm using the ver 1.1.0 project skeleton. Thanks @calinrada


The devtools are not updated so often. You should check http://docs.phalcon.io/en/latest/api/ better. Maybe the team should spend a little more time on devtools also.