Skip to content
This repository has been archived by the owner on Oct 17, 2022. It is now read-only.

flexicsystems/cookie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cookie Component

The Cookie component defines an object-oriented layer for the Cookie handling.

Resources

Examples

# add a new cookie

$cookie = (new Flexic\Cookie\Cookie('new_cookie'))
                ->setValue('new_cookie')
                ->setExpiration(time() + 3600)
                ->save();

Flexic\Cookie\Manager::set($new_cookie);

$cookie = Flexic\Cookie\Manager::get('new_cookie');
# handle an existing cookie (Cookies which already stored from old sessions)

$cookie = Flexic\Cookie\Manager::get('old_cookie', true)
                ->setValue('new_cookie')
                ->setExpiration(time() + 3600)
                ->update();

Flexic\Cookie\Manager_:set($cookie, true);

$cookie = Flexic\Cookie\Manager::get('new_cookie');
# remove an cookie

Flexic\Cookie\Manager::delete('old_cookie');
# get all cookies

Flexic\Cookie\Manager::getCookieList();