Download the PHP package tobento/service-cookie without Composer
On this page you can find all versions of the php package tobento/service-cookie. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package service-cookie
Cookie Service
The cookie service provides a way for managing cookies for PHP applications.
Table of Contents
- Getting started
- Requirements
- Highlights
- Documentation
- Basic Usage
- Using Middleware
- Read Cookie
- Cookie Values Factory
- Cookie Values
- Write Cookie
- Cookies Factory
- Cookies
- Cookie Factory
- Cookie
- Cookies Processor
- Basic Usage
- Credits
Getting started
Add the latest version of the cookie service project running this command.
Requirements
- PHP 8.0 or greater
Highlights
- Framework-agnostic, will work with any project
- Decoupled design
Documentation
Basic Usage
Simple example using the cookie service in your application:
Using Middleware
You may prefer to use the middlware:
Read and write cookies
Read Cookie
Cookie Values Factory
You may use the to create cookie values:
createCookieValuesFromArray
You may check out the Cookie Values to learn more about it.
createCookieValuesFromCookies
You may check out the Cookie Values to learn more about it.
You may check out the Cookies to learn more about it.
Cookie Values
get
Get a cookie value by name.
has
Check if a cookie value by name exists.
all
Get a cookie values.
map
Map over each of the cookie values returning a new instance.
withValues
Returns a new instance with the specified values.
Write Cookie
Cookies Factory
You may use the to create cookies:
createCookies
You may check out the Cookie Factory to learn more about it.
You may check out the Cookies to learn more about it.
createCookiesFromKeyValuePairs
Create new cookies from key/value pairs. May be used for creating cookies from the superglobal.
You may check out the Cookie Factory to learn more about it.
You may check out the Cookies to learn more about it.
createCookiesFromArray
You may check out the Cookie Factory to learn more about it.
You may check out the Cookies to learn more about it.
Cookies
You may check out the Cookie Factory to learn more about it.
addCookie
Add a cookie object.
You may check out the Cookie Factory to learn more about it.
add
Add a cookie.
You may change the default values by a custom .
You may check out the Cookie Factory to learn more about it.
get
Returns a cookie by the specified parameters or null if not found.
clear
Clear a cookie by the specified parameters.
column
Sometimes you may need only specific columns from the cookies returning an .
first
Returns the first cookie, otherwise null.
all
Returns all cookies.
filter
Returns a new instance with the filtered cookies.
name
Returns a new instance with the name filtered.
path
Returns a new instance with the path filtered.
domain
Returns a new instance with the domain filtered.
map
Map over each of the cookies returning a new instance.
toHeader
Returns the cookie header.
Cookie Factory
You may use the to create a cookie:
createCookie
You may check out the Cookie to learn more about it.
createCookieFromArray
You may check out the Cookie to learn more about it.
Cookie
Cookies Processor
You may use the default cookies processor for encrypting and decrypting cookie values or you may create a custom processor suiting your needs.
Check out the Encryption Service to learn more about it.
processCookieValues
Decrypting the cookie values.
You may check out the Cookie Values to learn more about it.
processCookies
Encrypting the cookie values.
You may check out the Cookies to learn more about it.
whitelistCookie
You may use the to add a cookie the whitelist meaning no encryption/decryption is done.
whitelistedCookies
Returns the whitelisted cookies.
Credits
- Tobias Strub
- All Contributors