1. Go to this page and download the library: Download guilherme/konf-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/ */
guilherme / konf-cookie example snippets
use Guilherme\KonfCookie\Cookie;
$cookie = new Cookie();
// Set a cookie that expires in 1 hour
$cookie->set('user', 'john_doe', 3600);
$cookie->set(
'user', // Cookie name
'john_doe', // Cookie value
3600, // Expiration in seconds
'/', // Path
'', // Domain
true, // Secure (HTTPS only)
true // HttpOnly (not accessible by JavaScript)
);
use Guilherme\KonfCookie\Cookie;
$cookie = new Cookie();
// Set a cookie
$cookie->set('user', 'john_doe', 3600);
// Get a cookie
echo $cookie->get('user');
// Check if it exists
if ($cookie->exists('user')) {
echo "Exists!";
}
// List all cookies
print_r($cookie->getAll());
// Delete it
$cookie->destroy('user');
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.