Bluz\Session\Session::get PHP Method

get() public method

Get value by key
public get ( string $key ) : mixed
$key string
return mixed
    public function get($key)
    {
        if ($this->contains($key)) {
            return $_SESSION[$this->namespace][$key];
        } else {
            return null;
        }
    }

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'));
 }