1. Go to this page and download the library: Download phpatom/cookies library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
phpatom / cookies example snippets
# create a new router
use Atom\Cookies\Cookie;
use Atom\Cookies\CookieConfig;
$myCookie = Cookie::create("foo","bar")
->withDomain("mydomain.com")
->withPath("/")
->thatExpiresOn("2 days");
$myCookie->applyTo($response); // ResponseInterface
// Cookie default config
CookieConfig::configure()
->withDomain("foo.com")
->withHttpOnly(true);
//will use default config
$myCookie = new Cookie("foo","bar");
echo $myCookie->getDomain(); // foo.com
echo $myCookie->isHttpOnly(); // true