Cookie::set PHP Method

set() public method

A basic setter, which will set a value to a given property in the $_SESSION array, stored in the key of $this->_index
public set ( string $name, string $value )
$name string The name of the property
$value string The value of the property
    public function set($name, $value)
    {
        $_SESSION[$this->_index][$name] = $value;
    }

Usage Example

Example #1
0
 public function testSetData()
 {
     $this->cookie->set('fairy', 'test');
     $this->cookie->set_cookie_data(array('fairy' => 'Blum'));
     $this->assertEquals(0, count($this->cookie->get_updates()));
     $this->assertEquals('Blum', $this->cookie->get('fairy', 'test'));
 }
All Usage Examples Of Cookie::set