Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7907425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T11:25:31+00:00 2026-06-03T11:25:31+00:00

This is how I set sessions $this -> sess = new Zend_Session_Namespace(‘user’); $this ->

  • 0

This is how I set sessions

$this -> sess = new Zend_Session_Namespace('user');
$this -> sess -> username = "Bob";
$this -> sess -> admin = "1";

And this is how I kill it

setcookie("mycookiename",md5(rand(10,1200)),time() - (60 * 60),"/",".site.com");
$_SESSION = array();
session_destroy();
$this -> _redirect('/');

but it still keeps the $this->sess->admin as ‘1’ … username is gone but admin stays as one. What’s the correct way to delete ALL sessions associated with the client?

If I do

$this->sess->admin = 0;

Then it works, but I doubt this is the right way for each session variable that i hold.

I also tried

setcookie("mycookiename",md5(rand(10,1200)),time() - (60 * 60),"/",".site.com");
Zend_Session::namespaceUnset($this->sess);

and it didn’t work, it didn’t close any sessions.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T11:25:38+00:00Added an answer on June 3, 2026 at 11:25 am

    To delete ALL sessions associated with the client use this:

    \Zend_Session::destroy( true );
    

    This will delete the entire session and also send a header request to the client to remove any cookies associated with the session. You can alternatively set the parameter of this method to false to not delete the user cookies. But please note:

    Zend_Session::destroy(true) must either be called before PHP has sent
    HTTP headers, or output buffering must be enabled. It will destory all
    of the persistent data associated with the current session. However,
    no variables in PHP are affected, so your namespaced sessions
    (instances of Zend_Session_Namespace) remain readable.

    To remove these use the following approach:

    $ns = 'auth'
    $namespace = new \Zend_Session_Namespace( $ns );
    $namespace->unsetAll();
    

    Please see here for further information

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table named sessions setup like this: ################################# # set # timestamp
I set a session like this: request.session['mykey']= 33 How do I clear it? I
If I set cookies like this: $_SESSION[md5('ponies'.$salt)] = $value; so that only knowing the
In this set of statements: if(robot1Count < 12) { robot1Count++; } else if(robot1Count <
I have this set of radio buttons, let's say radio 1 radio 2 radio
I have this set of tabs in css: /*tabs*/ .tabs { position: relative; min-height:
I have this set of Javascript code that works fine in IE (any version),
I have something like this set up: class CategoryPage (webapp.RequestHandler): def get(self): ** DO
I've completed this set up on a fair few IIS 6 boxes, but one
I have set the sessions into rows. <div class=container id=session1> <div class=row session> <div

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.