CookieComponent Class Reference

Inheritance diagram for CookieComponent:

Object

List of all members.


Public Member Functions

 del ($key)
 destroy ()
 initialize (&$controller, $settings)
 read ($key=null)
 startup ()
 type ($type= 'cipher')
 write ($key, $value=null, $encrypt=true, $expires=null)

Public Attributes

 $domain = ''
 $key = null
 $name = 'CakeCookie'
 $path = '/'
 $secure = false
 $time = null

Detailed Description

Definition at line 42 of file cookie.php.


Member Function Documentation

CookieComponent::del ( key  ) 

Delete a cookie value

Optional [Name.], reguired key $this->Cookie->read('Name.key);

You must use this method before any output is sent to the browser. Failure to do so will result in header already sent errors.

Parameters:
string $key Key of the value to be deleted public

Definition at line 275 of file cookie.php.

References $key, and $name.

CookieComponent::destroy (  ) 

Destroy current cookie

You must use this method before any output is sent to the browser. Failure to do so will result in header already sent errors.

public

Definition at line 303 of file cookie.php.

References $key, and $name.

CookieComponent::initialize ( &$  controller,
settings 
)

Main execution method.

Parameters:
object $controller A reference to the instantiating controller object public

Definition at line 161 of file cookie.php.

References Object::_set(), and Configure::read().

CookieComponent::read ( key = null  ) 

Read the value of the $_COOKIE[$key];

Optional [Name.], reguired key $this->Cookie->read(Name.key);

Parameters:
mixed $key Key of the value to be obtained. If none specified, obtain map key => values
Returns:
string or null, value for specified key public

Definition at line 238 of file cookie.php.

References $key, and $name.

CookieComponent::startup (  ) 

Start CookieComponent for use in the controller

public

Definition at line 170 of file cookie.php.

CookieComponent::type ( type = 'cipher'  ) 

Will allow overriding default encryption method.

Parameters:
string $type Encryption method public
Todo:
NOT IMPLEMENTED

Definition at line 326 of file cookie.php.

CookieComponent::write ( key,
value = null,
encrypt = true,
expires = null 
)

Write a value to the $_COOKIE[$key];

Optional [Name.], reguired key, optional $value, optional $encrypt, optional $expires $this->Cookie->write('[Name.]key, $value);

By default all values are encrypted. You must pass $encrypt false to store values in clear test

You must use this method before any output is sent to the browser. Failure to do so will result in header already sent errors.

Parameters:
mixed $key Key for the value
mixed $value Value
boolean $encrypt Set to true to encrypt value, false otherwise
string $expires Can be either Unix timestamp, or date string public

Definition at line 195 of file cookie.php.

References $key, and $name.


Member Data Documentation

CookieComponent::$domain = ''

Definition at line 94 of file cookie.php.

CookieComponent::$key = null

Definition at line 117 of file cookie.php.

Referenced by del(), destroy(), read(), and write().

CookieComponent::$name = 'CakeCookie'

Definition at line 52 of file cookie.php.

Referenced by del(), destroy(), read(), and write().

CookieComponent::$path = '/'

Definition at line 79 of file cookie.php.

CookieComponent::$secure = false

Definition at line 107 of file cookie.php.

CookieComponent::$time = null

Definition at line 64 of file cookie.php.


The documentation for this class was generated from the following file: