1. Go to this page and download the library: Download pinga/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/ */
(new \Delight\Cookie\Cookie('SID'))->setValue('31d4d96e407aad42')->setMaxAge(60 * 60 * 24)->setSameSiteRestriction('None')->save();
$cookie->delete();
// or
$cookie->deleteAndUnset();
\Delight\Cookie\Cookie::exists('first_visit');
\Delight\Cookie\Cookie::get('first_visit');
// or
\Delight\Cookie\Cookie::get('first_visit', \time());
// start session and have session cookie with 'lax' same-site restriction
\Delight\Cookie\Session::start();
// or
\Delight\Cookie\Session::start('Lax');
// start session and have session cookie with 'strict' same-site restriction
\Delight\Cookie\Session::start('Strict');
// start session and have session cookie without any same-site restriction
\Delight\Cookie\Session::start(null);
// or
\Delight\Cookie\Session::start('None'); // Chrome 80+
session_regenerate_id();
// and
session_regenerate_id(true);
\Delight\Cookie\Session::regenerate();
// and
\Delight\Cookie\Session::regenerate(true);
\Delight\Cookie\Session::id();
session_id();
$value = \Delight\Cookie\Session::get($key);
// or
$value = \Delight\Cookie\Session::get($key, $defaultValue);
\Delight\Cookie\Session::set($key, $value);
if (\Delight\Cookie\Session::has($key)) {
// ...
}