On Tue, Mar 9, 2010 at 1:28 PM, Jake McGraw <jmcgr...@gmail.com> wrote:

> On Tue, Mar 9, 2010 at 12:05 AM, Cameron <themsel...@gmail.com> wrote:
> >
> >
> > On Tue, Mar 9, 2010 at 10:49 AM, Jake McGraw <jmcgr...@gmail.com> wrote:
> >>
> >>
> >> On Mon, Mar 8, 2010 at 8:51 PM, Cameron <themsel...@gmail.com> wrote:
> >>>
> >>> Ok, I just tried removing everything except for
> >>>
> >>> $data = $authAdapter->getResultRowObject(null, 'password');
> >>> $auth->getStorage()->write($data);
> >>>
> >>> all, the $authNamespace stuff is gone, and it makes no difference -
> still
> >>> can't log out. Does clearIdentity() not work when there's something in
> the
> >>> Zend_Auth instance's storage? Because I use the storage all around my
> >>> application... It forms the basis of my ACL class...
> >>>
> >>> Ohhhhh. Ok. Is it possible that Zend_Auth's storage is completely
> >>> separate to the authenticated session? that clearIdentity() doesn't
> touch
> >>> it?
> >>
> >> Typically, I don't mess with the identity created by the Auth Adapter.
> >> However, there are instances where you need to store more than the
> $identity
> >> (which may only be an email or userId), for that I use
> Session_Namespace,
> >> check out my example:
> >> http://gist.github.com/326089
> >> - jake
> >
> > So I'm doing this wrong? Because I've been pulling my identity out of
> > Zend_Auth like this:
> Zend_Auth::getInstance()->getStorage()->read()->id... I
> > don't recall why I was doing it like that, but it seemed to work at the
> > time.
> >
>
> You aren't ever required to directly interface with the Zend_Auth
> Storage instance, though there is nothing technically wrong with it, I
> prefer Zend_Auth::getInstance()->getIdentity() if the identity is
> available.
>
> I think the disconnect here is that you're trying to store more than
> the user identity (email, userId, username, etc) inside the the
> instance of Zend_Auth storage, which isn't technically wrong, it's
> just not what the built in default storage system was written for. I
> work around this by using another persistent storage method, in my
> case Zend_Session_Namespace.
>
> - jake
>

Ok, well, I can remove all that extra stuff and rip it back down to just
using Zend_Auth::getInstance()->getIdentity(), I'm guessing that's going to
fix the clearIdentity() problem? It sounds to me like clearIdentity() does
exactly what it says, and that would need to log myself out by using some
sort of clearStorage() method as well...

Reply via email to