v2.1.11 2021-11-05 06:35 UTC

This package is auto-updated.

Last update: 2024-02-08 16:35:51 UTC


Simple and Light Cookie Class for Php

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require


  • Create, Delete, Set Cookie
  • Set Prefix, Domain, Secure, OnlyHttp, Path


run the following command directly.

$ composer require omerfdmrl/cookie


include 'vendor/autoload.php';

use Omerfdmrl\Cookie\Cookie;

$cookie = new Cookie;

// You can change cookie name's prefix

// They will be work on just $_SERVER['HTTPS'];
// Default is False

// They will be work just HTTP protocol. Sometimes they can block xss attacks. 
// Default is False

// For use in path. If you set as '/path/path2'; Cookie will start only '/path/path2'
// Default is ''

// If you set it like this, cookie will saved for subdomains to
// Default is ''

// Create Cookie
// You can use: time() + 3600 etc.
// You can use: '+1 day' / '+5 week' / '+2 year' etc.
$cookie->set('my_cookie','my_value','+1 day');

// This cookie will be forever

// They will return 'my_value'. If cookie doens't exist, They will return False

// You can change cookie's value

// Delete Cookie


Documentation page: Cookie Docs


MIT Licence


  1. Fork it ( )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request


  • omerfdmrl Ömer Faruk Demirel - creator, maintainer