Don't you think that more convinient would be to use
session_name($sessname) with unique $sessname for every project and
don't bother yourself with distinguish it inside project?
Guillermo Caserotto wrote:
> Thanks! Its works.
> Although I cant instantiate Zend_Auth, its a singleton.
>
> On each project i write this code:
>
> Project 1:
> $p = new Zend_Auth_Storage_Session('PROJECT1');
> $aut = Zend_Auth::getInstance();
> $aut->setStorage($p);
> $result = $aut->authenticate($autAdapter);
>
> Project 2:
> $p = new Zend_Auth_Storage_Session('PROJECT2');
> $aut = Zend_Auth::getInstance();
> $aut->setStorage($p);
> $result = $aut->authenticate($autAdapter);
>
> Then in my IndexController I check what session is, it can be done in
> many ways:
> For now i used:
>
> if(isset( $_SESSION['PROJECT1'] ) {
> echo "loggedIn";
> };
>
>
> Thanks,
> Guille.
> ------------------------------------------------------------------------
> *From:* Hector Virgen <djvirgen@gmail.com>
> *To:* Tom Graham <tom.graham@jadu.co.uk>
> *Cc:* fw-auth@lists.zend.com
> *Sent:* Wednesday, April 22, 2009 12:23:34 PM
> *Subject:* Re: [fw-auth] Two sessions in one server
>
> If you want to make sure there are no other session conflicts between
> the two projects, you should take a look at the Zend_Session
> configuration options:
>
> http://framework.zend.com/manual/en/zend.session.global_session_management.html
>
> You can give each project a unique session name so there will be no
> conflicts, even without modifying Zend_Auth.
--
Piotr Kabacinski
a2Fib3Q
没有评论:
发表评论