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