1. Go to this page and download the library: Download drewlabs/cookie 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/ */
drewlabs / cookie example snippets
use Drewlabs\Cookie\Factory;
// Creates a session cookie with name and value as first parameters
$cookie = Factory::new()->create('sessionId',uniqid('session').time(), 0);
use Drewlabs\Cookie\Factory;
$expiresAt = (new \DateTimeImmutable())->format('U');
$cookie = Factory::new()->createFromString("sessionId=e8bb43229de9; Expires=$expiresAt; Domain=foo.example.com; Path=/; Secure; HttpOnly");