Php Cookie Class

Related tags

HTTP cookie
Overview

Security

Simple and Light Cookie Class for Php

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

Features

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

Install

run the following command directly.

$ composer require omerfdmrl/cookie

Usage

include 'vendor/autoload.php';

use Omerfdmrl\Cookie\Cookie;

$cookie = new Cookie;

// You can change cookie name's prefix
$cookie->set_prefix('prefix_');

// They will be work on just $_SERVER['HTTPS'];
// Default is False
$cookie->set_secure(False);

// They will be work just HTTP protocol. Sometimes they can block xss attacks. 
// Default is False
$cookie->set_onlyHttp(False);

// For use in path. If you set as '/path/path2'; Cookie will start only '/path/path2'
// Default is ''
$cookie->set_path('/path');

// If you set it like this, cookie will saved for subdomains to
// Default is ''
$cookie->set_domain('.domain.com')

// 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
$cookie->forever('forever_cookie','forever_value');

// They will return 'my_value'. If cookie doens't exist, They will return False
$cookie->get('my_cookie');

// You can change cookie's value
$cookie->set('my_cookie','second_value');

// Delete Cookie
$cookie->delete('my_cookie');

Docs

Documentation page: Cookie Docs

Licence

MIT Licence

Contributing

  1. Fork it ( https://github.com/omerfdmrl/cookie/fork )
  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

Contributors

  • omerfdmrl Ömer Faruk Demirel - creator, maintainer
You might also like...
Requests for PHP is a humble HTTP request library. It simplifies how you interact with other sites and takes away all your worries.

Requests for PHP Requests is a HTTP library written in PHP, for human beings. It is roughly based on the API from the excellent Requests Python librar

Unirest in PHP: Simplified, lightweight HTTP client library.

Unirest for PHP Unirest is a set of lightweight HTTP libraries available in multiple languages, built and maintained by Mashape, who also maintain the

Simple handler system used to power clients and servers in PHP (this project is no longer used in Guzzle 6+)

RingPHP Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function. RingPHP be used to power HTTP clie

The best php curl library.

中文文档 About Implemented by using php-curl internal io event with high performance,high universality,high extensibility which especially suitable for ma

PHP Secure Communications Library

phpseclib - PHP Secure Communications Library Supporting phpseclib Become a backer or sponsor on Patreon One-time donation via PayPal or crypto-curren

Custom PHP curl library for the Laravel 5 framework - developed by Ixudra
Custom PHP curl library for the Laravel 5 framework - developed by Ixudra

ixudra/curl Custom PHP cURL library for the Laravel 4 or 5 framework - developed by Ixudra. The package provides an easy interface for sending cURL re

PHP cURL for feed Instagram Graph API

php-curl-instagram-graph PHP cURL for feed Instagram Graph API Script made based on the new (2020) Instagram API that requires authorization token gen

↪️ Bypass for PHP creates a custom HTTP Server to return predefined responses to client requests
↪️ Bypass for PHP creates a custom HTTP Server to return predefined responses to client requests

Bypass for PHP provides a quick way to create a custom HTTP Server to return predefined responses to client requests.Useful for tests with Pest PHP or PHPUnit.

`phplint` is a tool that can speed up linting of php files by running several lint processes at once.
`phplint` is a tool that can speed up linting of php files by running several lint processes at once.

`phplint` is a tool that can speed up linting of php files by running several lint processes at once.

Releases(v2.1.11)
Owner
Ömer Faruk Demirel
Red Hat Boy
Ömer Faruk Demirel
Simple PHP curl wrapper class

php-curl The smallest possible OOP wrapper for PHP's curl capabilities. Note that this is not meant as a high-level abstraction. You should still know

Andreas Lutro 243 Dec 5, 2022
Retrofit implementation in PHP. A REST client for PHP.

Retrofit PHP Retrofit is a type-safe REST client. It is blatantly stolen from square/retrofit and implemented in PHP. ❗ UPGRADE NOTICE ❗ Version 3 int

null 153 Dec 21, 2022
HTTP header kit for PHP 7.1+ (incl. PHP 8) based on PSR-7

HTTP header kit for PHP 7.1+ (incl. PHP 8) based on PSR-7 Installation composer require sunrise/http-header-kit How to use? HTTP Header Collection Mor

Sunrise // PHP 63 Dec 31, 2022
Express.php is a new HTTP - Server especially made for RESTful APIs written in PHP.

express.php Express.php is a new HTTP - Server especially made for RESTful APIs written in PHP. Features Fast The Library is handles requests fast and

null 5 Aug 19, 2022
PHP Curl ile letgo api kütüphanesi oluşturuldu. php ile letgo giriş yap.

Kendi LETGO API ile işlemler gerçekleştirelim. // email işlemleri $server = 'imap.gmail.com'; $user = '[email protected]'; $pass = 'password'; $port = 9

Görkem Bayraktar 2 Nov 3, 2022
Guzzle, an extensible PHP HTTP client

Guzzle, PHP HTTP client Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and trivial to integrate with web services. Simple interf

Guzzle 22.3k Jan 2, 2023
Requests for PHP is a humble HTTP request library. It simplifies how you interact with other sites and takes away all your worries.

Requests for PHP Requests is a HTTP library written in PHP, for human beings. It is roughly based on the API from the excellent Requests Python librar

null 3.5k Dec 31, 2022
A Chainable, REST Friendly, PHP HTTP Client. A sane alternative to cURL.

Httpful Httpful is a simple Http Client library for PHP 7.2+. There is an emphasis of readability, simplicity, and flexibility – basically provide the

Nate Good 1.7k Dec 21, 2022
PHP's lightweight HTTP client

Buzz - Scripted HTTP browser Buzz is a lightweight (<1000 lines of code) PHP 7.1 library for issuing HTTP requests. The library includes three clients

Kris Wallsmith 1.9k Jan 4, 2023
HTTPlug, the HTTP client abstraction for PHP

HTTPlug HTTPlug, the HTTP client abstraction for PHP. Intro HTTP client standard built on PSR-7 HTTP messages. The HTTPlug client interface is compati

The PHP HTTP group 2.4k Dec 30, 2022