Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-04-2007, 07:58 PM
Junior Member
 
Join Date: Oct 2007
Posts: 2
Default Zend_Session ???

Im trying to utilize the Zend_Session_Namespace functionality and I can't get this thing to go...any help would be appreciated

My bootstrapper has the following...

$idSession = new Zend_Session_Namespace('ID_Session');
$idSession->_myid= "5"

Now in my IndexController I try and reset this id like so...

$idSession = new Zend_Session_Namespace('ID_Session');
$idSession ->_myid= "10";

Then in my view I display this...and it always comes up as 5...so its not modifying the session variable...im assuming its "read-only"? How can I get it so I can modify this value...

Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 10-05-2007, 12:56 AM
Elemental's Avatar
Senior Member
 
Join Date: Jul 2007
Posts: 119
Default

Quote:
Originally Posted by Jerami View Post
$idSession = new Zend_Session_Namespace('ID_Session');
$idSession->_myid= "5";
add:
Code:
Zend_Registry::set('session', $idSession);
Quote:
Originally Posted by Jerami View Post
Now in my IndexController I try and reset this id like so...

$idSession = new Zend_Session_Namespace('ID_Session');
$idSession ->_myid= "10";
replace with:
Code:
$idSession = Zend_Registry::get('session');
$idSession->myid="10";
see how that goes...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 10-05-2007, 12:50 PM
Junior Member
 
Join Date: Oct 2007
Posts: 2
Default

Thanks, I will give that a whirl...I guess I didnt realize that you needed to utilize Zend_Registry...it makes sense though.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 03-07-2008, 04:43 AM
Junior Member
 
Join Date: Mar 2008
Posts: 1
Default

Can someone "in the know" please include this in the docs? I've had the same problem and it took me forever to figure out. There's no reason this shouldn't be front-page material.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 03-07-2008, 11:47 AM
Junior Member
 
Join Date: Feb 2008
Posts: 15
Default

There is Zend Framework: Documentation

I played with it just yesterday:

Code:
Zend_Loader::loadClass('Zend_Session');
Zend_Loader::loadClass('Zend_Session_Namespace');

in bootstrap 
Zend_Session::start();
in indexcontroller

$sess = new Zend_Session_Namespace('user');
$sess->info = array( 'id' => '2',
'username' => 'David',
'pass' => '132');
Zend_Session::rememberMe(3600); // remember me for one hour
$sess->lock(); 
(you probably could use this when authenticating the data)

Zend_Session::namespaceGet('user'); //Experimental, haven't even tested it
Note, i'm just an amateur in ZF, still trying to work my way in on using sessions in a secured way
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 11:43 AM.