J. Erik Heinz wrote:
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.

Just like in User class, storage's parameters are used for initialization purposes only. If you wan to write/read something to/from the storage (directly, for User and many others this is done automatically - see User::initialize and User::shutdown for example) use read/write methods.

Regarding the naming point of the functions i would say that
SessionStorage should work on subsequent request as well...

I see no conflict here.

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.

Session id is (usually) stored in your browser as a cookie and it's your browser who sends it to the server and agavi application within every request you make. Your browser doesn't know that it should store/send a different cookie for different tabs. Neither does your web application know anything about tabs. To make this work you would have to .. hmm... dunno... maybe somehow alter the cookie name when a "new session" is started (a new user logs in).

You are obviously new to the whole concept of web application sessions and cookies. Maybe someone reading this list could lead you to some good site explaining the basics about these. Anyone? PHP manual's chapters about cookies and sessions might be a good starting point.


-veikko

_______________________________________________
agavi-dev mailing list
[email protected]
http://labworkz.com/cgi-bin/mailman/listinfo/agavi-dev

Reply via email to