How to destroy Zend_Session_Namespace without session_destroy
Asked Answered
A

1

13

I store a couple of value in a temporary session using: $job = new Zend_Session_Namespace('application');

How would I destroy only the session application without clearing all sessions.

Accordance answered 8/11, 2011 at 16:8 Comment(0)
N
32

To remove a value from a session, use PHP's unset() function on the object property. Let's say $job has a property 'username' like so :

$job = new Zend_Session_Namespace('application');
$job->username = 'test';

To remove username from the session just do :

unset($job->username);

To remove the whole 'application' namespace and asociated data you can use :

Zend_Session::namespaceUnset('application');
Ningsia answered 8/11, 2011 at 16:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.