Documentation

Class Phalcon\Http\Response\Cookies

extends abstract class Phalcon\Di\Injectable

implements Phalcon\Events\EventsAwareInterface, Phalcon\Di\InjectionAwareInterface, Phalcon\Http\Response\CookiesInterface

Source on GitHub

This class is a bag to manage the cookies A cookies bag is automatically registered as part of the ‘response’ service in the DI

Methods

public __construct (unknown $name, [unknown $value], [int $expire], [string $path], [boolean $secure], [string $domain], [boolean $httpOnly])

Phalcon\Http\Response\Cookie constructor

public Phalcon\Http\Response\Cookies useEncryption (boolean $useEncryption)

Set if cookies in the bag must be automatically encrypted/decrypted

public boolean isUsingEncryption ()

Returns if the bag is automatically encrypting/decrypting cookies

public Phalcon\Http\Response\Cookies set (string $name, [mixed $value], [int $expire], [string $path], [boolean $secure], [string $domain], [boolean $httpOnly])

Sets a cookie to be sent at the end of the request This method overrides any cookie set before with the same name

public Phalcon\Http\Cookie get (string $name)

Gets a cookie from the bag

public boolean has (string $name)

Check if a cookie is defined in the bag or exists in the $_COOKIE superglobal

public boolean delete (string $name)

Deletes a cookie by its name This method does not removes cookies from the $_COOKIE superglobal

public boolean send ()

Sends the cookies to the client Cookies aren’t sent if headers are sent in the current request

public Phalcon\Http\Response\Cookies reset ()

Reset set cookies

public setDI (Phalcon\DiInterface $dependencyInjector) inherited from Phalcon\Di\Injectable

Sets the dependency injector

public Phalcon\DiInterface getDI ([unknown $error], [unknown $notUseDefault]) inherited from Phalcon\Di\Injectable

Returns the internal dependency injector

public setEventsManager (Phalcon\Events\ManagerInterface $eventsManager) inherited from Phalcon\Di\Injectable

Sets the event manager

public Phalcon\Events\ManagerInterface getEventsManager () inherited from Phalcon\Di\Injectable

Returns the internal event manager

public boolean fireEvent (string $eventName, [unknown $data], [unknown $cancelable]) inherited from Phalcon\Di\Injectable

Fires an event, implicitly calls behaviors and listeners in the events manager are notified

public boolean fireEventCancel (string $eventName, [unknown $data], [unknown $cancelable]) inherited from Phalcon\Di\Injectable

Fires an event, implicitly calls behaviors and listeners in the events manager are notified This method stops if one of the callbacks/listeners returns boolean false

public boolean hasService (string $name) inherited from Phalcon\Di\Injectable

Check whether the DI contains a service by a name

public mixed getResolveService (string $name, [unknown $args], [unknown $noerror], [unknown $noshared]) inherited from Phalcon\Di\Injectable

Resolves the service based on its configuration

public __get (unknown $property) inherited from Phalcon\Di\Injectable

Magic method __get

public __sleep () inherited from Phalcon\Di\Injectable

...

public __debugInfo () inherited from Phalcon\Di\Injectable

...