destroy() public method

Helper method to destroy invalid sessions.
public destroy ( ) : void
return void
 /**
  * Used to destroy sessions
  *
  * In your controller: $this->Session->destroy();
  *
  * @return void
  * @link http://book.cakephp.org/2.0/en/core-libraries/components/sessions.html#SessionComponent::destroy
  */
 public function destroy()
 {
     return Session::destroy();
 }
Beispiel #2
0
 /**
  * testDestroy method
  *
  * @return void
  */
 public function testDestroy()
 {
     $session = new Session();
     $session->start();
     $session->write('bulletProof', 'invincible');
     $session->id('foo');
     $session->destroy();
     $this->assertFalse($session->check('bulletProof'));
 }
 /**
  * Used to destroy sessions
  *
  * In your controller: $this->Session->destroy();
  *
  * @return void
  * @link http://book.cakephp.org/2.0/en/core-libraries/components/sessions.html#SessionComponent::destroy
  */
 public function destroy()
 {
     $this->_session->destroy();
 }
 /**
  * tearDown method
  *
  * @return void
  */
 public function tearDown()
 {
     parent::tearDown();
     Session::destroy();
 }