PHP code example of overclokk / cookie

1. Go to this page and download the library: Download overclokk/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/ */

    

overclokk / cookie example snippets


    

    $cookie = new \Overclokk\Cookie\Cookie();

    $cookie = new \Overclokk\Cookie\Cookie( $_COOKIE );

    $cookie_value = $cookie->get( 'cookie_name' );

    $minutes = 120 * 60;
    $cookie->set( 'cookie_name', 'cookie_value', $minutes );

    $cookie->forever( 'cookie_name', 'cookie_value' );

    $cookie->delete('cookie_name');