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

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?



51.2k
Accepted
answer

@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



51.2k

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