CookieComponent Class Reference

Inheritance diagram for CookieComponent:

Object List of all members.

Public Member Functions

 __cookieVarNames ($name)
 __decrypt ($values)
 __delete ($name)
 __encrypt ($value)
 __expire ($expires=null)
 __explode ($string)
 __implode ($array)
 __write ($name, $value)
 del ($key)
 destroy ()
 initialize (&$controller, $settings)
 read ($key=null)
 startup ()
 type ($type= 'cipher')
 write ($key, $value=null, $encrypt=true, $expires=null)

Public Attributes

 $__expires = 0
 $__reset = null
 $__type = 'cipher'
 $__values = array()
 $domain = ''
 $key = null
 $name = 'CakeCookie'
 $path = '/'
 $secure = false
 $time = null

Detailed Description

Definition at line 40 of file cookie.php.


Member Function Documentation

CookieComponent::__cookieVarNames ( name  ) 

Creates an array from the $name parameter which allows the dot notation similar to one used by Session and Configure classes

Parameters:
string $name Name with or without dot notation
Returns:
array Extracted names private

Definition at line 442 of file cookie.php.

References $name.

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

CookieComponent::__decrypt ( values  ) 

Decrypts $value using var $type method in Security class

Parameters:
array $values Values to decrypt
Returns:
string decrypted string private

Definition at line 405 of file cookie.php.

References $key, $name, and __explode().

Referenced by destroy(), read(), and startup().

CookieComponent::__delete ( name  ) 

Sets a cookie expire time to remove cookie value

Parameters:
string $name Name of cookie private

Definition at line 377 of file cookie.php.

References $name, and name().

Referenced by del(), and destroy().

CookieComponent::__encrypt ( value  ) 

Encrypts $value using var $type method in Security class

Parameters:
string $value Value to encrypt
Returns:
string encrypted string private

Definition at line 387 of file cookie.php.

References __implode().

Referenced by __write().

CookieComponent::__expire ( expires = null  ) 

Set the expire time for a session variable.

Creates a new expire time for a session variable. $expire can be either integer Unix timestamp or a date string.

Used by write() CookieComponent::write(string, string, boolean, 8400); CookieComponent::write(string, string, boolean, '5 Days');

Parameters:
mixed $expires Can be either Unix timestamp, or date string
Returns:
int Unix timestamp private

Definition at line 345 of file cookie.php.

Referenced by startup(), and write().

CookieComponent::__explode ( string  ) 

Explode method to return array from string set in CookieComponent::__implode()

Parameters:
string $string String in the form key1|value1,key2|value2
Returns:
array Map of key and values private

Definition at line 473 of file cookie.php.

References $key.

Referenced by __decrypt().

CookieComponent::__implode ( array  ) 

Implode method to keep keys are multidimensional arrays

Parameters:
array $array Map of key and values
Returns:
string String in the form key1|value1,key2|value2 private

Definition at line 459 of file cookie.php.

References $key.

Referenced by __encrypt().

CookieComponent::__write ( name,
value 
)

Set cookie

Parameters:
string $name Name for cookie
string $value Value for cookie private

Definition at line 363 of file cookie.php.

References __encrypt(), and name().

Referenced by write().

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
Returns:
void public

Definition at line 274 of file cookie.php.

References $key, $name, __cookieVarNames(), __delete(), and read().

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.

Returns:
void public

Definition at line 305 of file cookie.php.

References $key, $name, __decrypt(), __delete(), and name().

CookieComponent::initialize ( &$  controller,
settings 
)

Main execution method.

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

Definition at line 159 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 236 of file cookie.php.

References $key, $name, __cookieVarNames(), __decrypt(), and name().

Referenced by del().

CookieComponent::startup (  ) 

Start CookieComponent for use in the controller

public

Definition at line 168 of file cookie.php.

References __decrypt(), __expire(), and name().

CookieComponent::type ( type = 'cipher'  ) 

Will allow overriding default encryption method.

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

Definition at line 328 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 193 of file cookie.php.

References $key, $name, __cookieVarNames(), __expire(), and __write().


Member Data Documentation

CookieComponent::$__expires = 0

Definition at line 152 of file cookie.php.

CookieComponent::$__reset = null

Definition at line 143 of file cookie.php.

CookieComponent::$__type = 'cipher'

Definition at line 136 of file cookie.php.

CookieComponent::$__values = array()

Definition at line 125 of file cookie.php.

CookieComponent::$domain = ''

Definition at line 92 of file cookie.php.

CookieComponent::$key = null

Definition at line 115 of file cookie.php.

Referenced by __decrypt(), __explode(), __implode(), del(), destroy(), read(), and write().

CookieComponent::$name = 'CakeCookie'

Definition at line 50 of file cookie.php.

Referenced by __cookieVarNames(), __decrypt(), __delete(), del(), destroy(), read(), and write().

CookieComponent::$path = '/'

Definition at line 77 of file cookie.php.

CookieComponent::$secure = false

Definition at line 105 of file cookie.php.

CookieComponent::$time = null

Definition at line 62 of file cookie.php.


The documentation for this class was generated from the following file:
Generated on Sun Nov 22 00:30:55 2009 for CakePHP 1.2.x.x (v1.2.4.8284) by doxygen 1.4.7