+ Reply to Thread
Results 1 to 3 of 3

Thread: unsset zend_session variable?

  1. #1
    Cirdan is offline Junior Member
    Join Date
    Jan 2009
    Posts
    17

    Default unsset zend_session variable?

    For some reason I can't unset a session variable. Any ideas?

    Code:
    if($session->forum_updates[$board['id']] >= 1) {
         unset($session->forum_updates[$board['id']]);
    }

  2. #2
    mark2331 is offline Senior Member
    Join Date
    Oct 2008
    Location
    Los Angeles, CA
    Posts
    109

    Default

    If you only want to unset the $board['id'] value in forum_updates, that should work. If you can't get it to work, try getting rid of the if... statement and the $board variable.

    [PHP]
    $session = new Zend_Session_Namespace('session');

    $session->forum_updates = array();
    $session->forum_updates['id'] = 14;
    var_dump($session->forum_updates['id']); // outputs int(14)
    unset($session->forum_updates['id']);
    var_dump($session->forum_updates['id']); // outputs undefined
    var_dump($session->forum_updates); // outputs array(0) { }
    [/PHP]

    If you want to unset all of forum_updates then:
    [PHP]
    $session->__unset('forum_updates');
    [/PHP]

  3. #3
    Cirdan is offline Junior Member
    Join Date
    Jan 2009
    Posts
    17

    Default

    Okay, I got it working. The problem was I kept setting the variable so it kept getting reset.

+ Reply to Thread

Similar Threads

  1. Zend_Session and Zend_Autoloader
    By nikochan in forum Authentication & Authorization
    Replies: 3
    Last Post: 02-09-2010, 06:37 AM
  2. Zend_Session permission
    By kunal9472 in forum Authentication & Authorization
    Replies: 1
    Last Post: 01-16-2010, 07:16 PM
  3. Zend_Session bootstrap
    By fernandomm in forum Authentication & Authorization
    Replies: 1
    Last Post: 11-20-2009, 08:43 PM
  4. Zend_Session with memcache
    By uberweb in forum Core Infrastructure
    Replies: 1
    Last Post: 06-16-2009, 03:49 PM
  5. Zend_Session ???
    By Jerami in forum Authentication & Authorization
    Replies: 7
    Last Post: 07-17-2008, 10:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts