Http Cookies

Provides very simple DTOsopen in new window for Http Cookieopen in new window. These DTOs do not offer any "advanced" capabilities to send Http Cookie headersopen in new window, nor to be populated from a Requestopen in new window / Responseopen in new window objects, or from Cookie Http headers. They are nothing more than data placeholders. Feel free to extend them with whatever logic your application might require.

Examples

<?php
use Aedart\Http\Cookies\Cookie;

$cookie = new Cookie([
    'name' => 'my_cookie',
    'value' => 'sweet'
]);
<?php
use Aedart\Http\Cookies\SetCookie;

$cookie = new SetCookie([
    'name' => 'my_cookie',
    'value' => 'sweet',
    'maxAge' => 60 * 5,
    'secure' => true
]);

Motivation

At the time of this writing, when searching for packagesopen in new window that contain the keyword "cookie", there seems to be an abundance of vendors. Many of them appear to have "cookie" objects with all kinds of behavioural or creational logic, each serving their respectful purpose. Unfortunately, it can be difficult to reuse some of those packages, without introducing various side-effects, such as additional behavioural logic that might not be favourable in certain circumstances.

For the above mentioned reason, this package was created, in hopes to offer only the data-placeholder aspects for Http Cookies. How you choose to use these, is entirely up to you.