1

I am using ZF1 and PHP7 in my project.

I am setting session as follows during login

$session = new Zend_Session_Namespace()
$session->email = 'example@example.com' //recieved via login form

Now, somewhere in my code, due to my use case, I want to destroy the session which has $session->email as example@example.com.

How can I do this? Thanks

Ayush Gupta
  • 8,716
  • 8
  • 59
  • 92

1 Answers1

1

to destroy all sessions simply use:

Zend_Session::destroy( true );

if you want detroy specisic session, use:

$sess = 'auth'
$namespace = new \Zend_Session_Namespace( $sess );
$namespace->unsetAll();
Piotr
  • 36
  • 5