Bluz\Session\Session::delete PHP Method

delete() public method

Unset
public delete ( string $key ) : void
$key string
return void
    public function delete($key)
    {
        if ($this->contains($key)) {
            unset($_SESSION[$this->namespace][$key]);
        }
    }

Usage Example

Example #1
0
 /**
  * Complex test for __unset
  *
  * @covers \Bluz\Session\Session::delete()
  */
 public function testUnset()
 {
     $this->session->set('moo', 'maz');
     $this->session->delete('moo');
     $this->assertNull($this->session->get('moo'));
 }