Page 1 of 1

Zend_Auth and Zend_Session

Posted: Sat Jan 17, 2009 11:23 am
by scaraffe
I had a question regarding implementing a login/logout functionality. Is it enough if i just use Zend_Auth or is it necessary to use Zend_Session too? cos i read somewer that Zend_Auth creates sessions internally. so will that create a problem having two diffrent sessions?

Re: Zend_Auth and Zend_Session

Posted: Sat Jan 17, 2009 1:02 pm
by Eran
Regardless of how you spin it, a user only has one session. Zend_Session uses namespacing (ie, meaningful array indexes in this case) to prevent conflicts in the session and data overwrites. If you do not manually set the session for Zend_Auth (or any other auth adapter), it will use the default - which should be good enough, unless you have several sites who use the same default on the same server, in which case there might be conflicts (the same identity available on several sites).

In usually set the session namespace manually to prevent such conflicts from occurring.

Re: Zend_Auth and Zend_Session

Posted: Thu Jan 29, 2009 5:48 pm
by josh
scaraffe wrote: will that create a problem having two diffrent sessions?
No, zend_session just wraps the existing superglobal. You could run into some headaches if you're not careful but you should be able to get the 2 solutions to interoperate.