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


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-19-2008, 03:48 PM
Junior Member
 
Join Date: Mar 2008
Posts: 3
Default Using custom storage session

I'm having problems interacting with my Storage Session.

This is done in my AuthController

PHP Code:
$auth Zend_Auth::getInstance();
require_once 
'Zend/Auth/Storage/Session.php';
$auth->setStorage(new Zend_Auth_Storage_Session('gwAuth'));
$authAdapter = new MyAuthAdapter($username$password);
$result $auth->authenticate($authAdapter); 
Once authentication is complete this is the code used to check if the session is set.

PHP Code:
require_once 'Zend/Auth/Storage/Session.php';
        if (
Zend_Session::namespaceIsset('gwAuth'))
        {
            
$this->_redirect('/home/index'); 
        } 
But I get this error:

Zend_Session is not marked as readable

Question 1: How do I set the session readable?

Question 2: What is the proper way to interact with the session, since it is not the default Zend_Auth?

I had everything working fine when using the default Zend_Auth, hasIdentity() / clearIdentity() etc.. however I need to use different namespaces and cannot get it to work.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-19-2008, 05:27 PM
Junior Member
 
Join Date: Mar 2008
Posts: 3
Default

I have it working now, however I'm not sure if it is working as it should...

Added to the bootstrap:

PHP Code:
require_once 'Zend/Session.php';
Zend_Session::start(); 
And this is the check:

PHP Code:
    require_once 'Zend/Auth/Storage/Session.php';
    if (!(
Zend_Session::namespaceIsset('gwAuth')))
    {
         
$this->_redirect('/auth/index');
    }
    else
    {
        
$this->_redirect('/home/index');
    } 

Is there anything flawed in here? This is what the actual cookie looks like:

Zend_Auth|a:1:{s:7:"storage";N;}gwAuth|a:1:{s:7:"s torage";s:5:"test2";}

Where test2 is my username.
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 12:35 PM.