PHP Class Pop\Web\Cookie

Author: Nick Sagona, III ([email protected])
Inheritance: implements ArrayAccess
Mostra file Open project: nicksagona/PopPHP Class Usage Examples

Public Methods

Method Description
__get ( string $name ) : mixed Get method to return the value of the $_COOKIE global variable.
__isset ( string $name ) : boolean Return the isset value of the $_COOKIE global variable.
__unset ( string $name ) : void Unset the value in the $_COOKIE global variable.
clear ( array $options = null ) : void Clear (delete) all cookies via unset($cookie)
delete ( string $name, array $options = null ) : void Delete a cookie directly
getDomain ( ) : string Return the current cookie domain.
getExpire ( ) : integer Return the current cookie expiration
getInstance ( array $options = [] ) : Cookie Determine whether or not an instance of the cookie object exists already, and instantiate the object if it does not exist.
getIp ( ) : string Return the current IP address.
getPath ( ) : string Return the current cookie path.
isHttpOnly ( ) : boolean Return if the cookie is HTTP only
isSecure ( ) : boolean Return if the cookie is secure
set ( string $name, mixed $value, array $options = null ) : Cookie Set a property in the cookie object that is linked to the $_COOKIE global variable.

Private Methods

Method Description
__construct ( array $options = [] ) : Cookie Constructor
setOptions ( array $options = [] ) : Cookie Private method to set options

Method Details

__get() public method

Get method to return the value of the $_COOKIE global variable.
public __get ( string $name ) : mixed
$name string
return mixed

__isset() public method

Return the isset value of the $_COOKIE global variable.
public __isset ( string $name ) : boolean
$name string
return boolean

__unset() public method

Unset the value in the $_COOKIE global variable.
public __unset ( string $name ) : void
$name string
return void

clear() public method

Clear (delete) all cookies via unset($cookie)
public clear ( array $options = null ) : void
$options array
return void

delete() public method

Delete a cookie directly
public delete ( string $name, array $options = null ) : void
$name string
$options array
return void

getDomain() public method

Return the current cookie domain.
public getDomain ( ) : string
return string

getExpire() public method

Return the current cookie expiration
public getExpire ( ) : integer
return integer

getInstance() public static method

Determine whether or not an instance of the cookie object exists already, and instantiate the object if it does not exist.
public static getInstance ( array $options = [] ) : Cookie
$options array
return Cookie

getIp() public method

Return the current IP address.
public getIp ( ) : string
return string

getPath() public method

Return the current cookie path.
public getPath ( ) : string
return string

isHttpOnly() public method

Return if the cookie is HTTP only
public isHttpOnly ( ) : boolean
return boolean

isSecure() public method

Return if the cookie is secure
public isSecure ( ) : boolean
return boolean

set() public method

Set a property in the cookie object that is linked to the $_COOKIE global variable.
public set ( string $name, mixed $value, array $options = null ) : Cookie
$name string
$value mixed
$options array
return Cookie