Overview

Namespaces

  • None
  • PHP
  • Wei
    • Validator

Classes

  • Apc
  • App
  • ArrayCache
  • Asset
  • Base
  • BaseCache
  • Bicache
  • Cache
  • Config
  • Cookie
  • Couchbase
  • Counter
  • Db
  • DbCache
  • E
  • Env
  • Error
  • FileCache
  • Gravatar
  • Http
  • Lock
  • Logger
  • Memcache
  • Memcached
  • MongoCache
  • Password
  • PhpError
  • Pinyin
  • Record
  • Redis
  • Request
  • Response
  • Router
  • SafeUrl
  • Session
  • Soap
  • T
  • Ua
  • Upload
  • Url
  • Uuid
  • Validate
  • View
  • WeChatApp
  • Wei
  • Overview
  • Namespace
  • Class
  • Tree

Class Cookie

A service that handles the HTTP request and response cookies

Wei\Base
Extended by Wei\Cookie implements ArrayAccess, IteratorAggregate
Namespace: Wei
Author: Twin Huang twinhuang@qq.com
Located at Cookie.php
Methods summary
public
# __construct( array $options = array() )

Constructor

Constructor

Parameters

$options

Throws

InvalidArgumentException
When option "wei" is not an instance of "Wei\Wei"

Overrides

Wei\Base::__construct()
public mixed
# __invoke( string $key, mixed $value = null, array $options = array() )

Get request cookie or set response cookie

Get request cookie or set response cookie

Parameters

$key
the name of cookie
$value
the value of cookie
$options
options for set cookie

Returns

mixed
public mixed
# get( string $key, mixed $default = null )

Get request cookie

Get request cookie

Parameters

$key
$default
default value

Returns

mixed
public mixed
# set( string $key, mixed $value = null, array $options = array() )

Set response cookie

Set response cookie

Parameters

$key
The name of cookie
$value
The value of cookie
$options

Returns

mixed
$this
public mixed
# remove( string $key )

Remove response cookie

Remove response cookie

Parameters

$key
the name of cookie

Returns

mixed
$this
public mixed
# clear( )

Clear all cookie data

Clear all cookie data

Returns

mixed
$this
public array
# toArray( )

Returns all cookie data

Returns all cookie data

Returns

array
public boolean
# offsetExists( string $offset )

Check if the offset exists

Check if the offset exists

Parameters

$offset

Returns

boolean

Implementation of

ArrayAccess::offsetExists()
public mixed
# offsetGet( string $offset )

Get the offset value

Get the offset value

Parameters

$offset

Returns

mixed

Implementation of

ArrayAccess::offsetGet()
public mixed
# offsetSet( string $offset, mixed $value )

Set the offset value

Set the offset value

Parameters

$offset
$value

Returns

mixed

Implementation of

ArrayAccess::offsetSet()
public mixed
# offsetUnset( string $offset )

Unset the offset

Unset the offset

Parameters

$offset

Returns

mixed
$this

Implementation of

ArrayAccess::offsetUnset()
public ArrayIterator
# getIterator( )

Retrieve an array iterator

Retrieve an array iterator

Returns

ArrayIterator

Implementation of

IteratorAggregate::getIterator()
Methods inherited from Wei\Base
__call(), __get(), getOption(), setOption()
Properties summary
protected array $data

The cookie data

The cookie data

# array()
Properties inherited from Wei\Base
$providers, $wei
Magic properties summary
public Wei\Request $request

A service that handles the HTTP request data

public Wei\Response $response

A service that handles the HTTP response data

Wei Framework API documentation generated by ApiGen