Why do you want to kill his old session?
On 28 led, 04:21, "yth" <digital_...@yahoo.com.hk> wrote: > Dear all, > > When a user logins, the controller calls the following function in the > myUser.class. The problem is, if he doesn't logout but then logins in > another computer/browser, the old session does not get killed. I tried to > use setAuthenticated(false) on users who have already authenticated, hoping > that his old session will get killed before he gets a new one. But it > doesn't work. > > Many thanks to you all. > > // Viewable inhttp://pastebin.com/f765fff66 > > public function login($loginId,$pwd){ > > $member=MemberPeer::getByLoginIdAndPassword($loginId,$pwd); > > if(!is_null($member)) { > > if($this->isAuthenticated()) > $this->setAuthenticated(false); // I would like to > logout the user if he/she already has a session, but it doesn't work > > $this->setAuthenticated(true); > $member->setLastLoginAt(time()); > $member->save(); > $this->setAttribute('member_id', $member->getMemberId()); > > return true; > } > return false; > > > > } -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.