PHP Class blink\http\CookieBag

Since: 0.2.0
Inheritance: extends blink\core\Object, implements IteratorAggregat\IteratorAggregate
Show file Open project: bixuehujin/blink Class Usage Examples

Public Methods

Method Description
__construct ( array $cookies = [], $config = [] )
add ( blink\http\Cookie $cookie ) Add a cookie to the bag.
all ( ) : blink\http\Cookie[] Returns all cookies.
count ( )
get ( $name ) : blink\http\Cookie | null Returns a cookie by name.
getIterator ( )
has ( $name ) : boolean Returns whether a cookie is exists.
normalize ( array $cookies )
remove ( $name ) Remove a cookie by name.

Method Details

__construct() public method

public __construct ( array $cookies = [], $config = [] )
$cookies array

add() public method

Add a cookie to the bag.
public add ( blink\http\Cookie $cookie )
$cookie blink\http\Cookie

all() public method

Returns all cookies.
Since: 0.3.0
public all ( ) : blink\http\Cookie[]
return blink\http\Cookie[]

count() public method

public count ( )

get() public method

Returns a cookie by name.
public get ( $name ) : blink\http\Cookie | null
$name
return blink\http\Cookie | null

getIterator() public method

public getIterator ( )

has() public method

Returns whether a cookie is exists.
public has ( $name ) : boolean
$name
return boolean

normalize() public static method

public static normalize ( array $cookies )
$cookies array

remove() public method

Remove a cookie by name.
public remove ( $name )
$name