ElggSession::set PHP Method

set() public method

Set an attribute
public set ( string $name, mixed $value ) : void
$name string Name of the attribute to set
$value mixed Value to be set
return void
    public function set($name, $value)
    {
        $this->storage->set($name, $value);
    }

Usage Example

 public function testMigrate()
 {
     $session = new ElggSession(new Elgg_Http_MockSessionStorage());
     $session->start();
     $session->set('foo', 5);
     $id = $session->getId();
     $this->assertTrue($session->migrate());
     $this->assertTrue($session->has('foo'));
     $this->assertNotEquals($id, $session->getId());
     $this->assertTrue($session->has('__elgg_session'));
 }
All Usage Examples Of ElggSession::set