Hi,
Veikko Mäkinen <[EMAIL PROTECTED]> words
on 18.11.2005 - 20:44 (+0200 Zulu-Time):
> J. Erik Heinz wrote:
> >I just wonder.. if i want to store userspecific information in the
> >BasicSecurityUser Object, do I use setAttributes() or setParameters().
>
> Only attributes are written to *Storage so if you want persistent data,
> you are to use attributes. If your data doesn't have to be stored for
> subsequent request, you might be better of using Request object or
> something else anyway.
I just played a little bit with SessionStorage and BasicSecurityUser.
I recognized, that if i want to use data for a subsequent request,
the $this->getContext()->getStorage()->setParameter() didn't work, but
$this->getContext()->getUser()->setAttribute() worked fine.
Regarding the naming point of the functions i would say that
SessionStorage should work on subsequent request as well...
Now I tried to open two browser-tabs (firefox) and logged in two times
with different users. In my opinion there should be 2 Sessions each
for one user - with user specific content.
But a look in my Session database showed me that i have only one
session. And when i try to display a page with user-specific content,
than i get only the content of the last logged in user.
Heres the code which is executed when the loggin succeded:
public function authorize($sNick) {
$oUser = new Users();
$iUser = $oUser->getUserIdByNick($sNick);
// I played with this code:
$this->getContext()->getUser()->shutdown();
$this->getContext()->getUser()->clearCredentials();
$this->getContext()->getUser()->initialize($this->getContext());
$this->getContext()->getUser()->setAttribute('userid', $iUser);
// or this one:
$this->getContext()->getStorage()->shutdown();
$this->getContext()->getStorage()->initialize($this->getContext());
$this->getContext()->getStorage()->setParameter('userid', $iUser);
}
Any Ideas?
Cheers Erik
--
J. Erik Heinz
Keyboard-samuraing in process
_______________________________________________
agavi-dev mailing list
[email protected]
http://labworkz.com/cgi-bin/mailman/listinfo/agavi-dev