Dear Tom,

Just like facebook, if I login in a public computer but forgot to logout, later when I am home and then login, the old session (may not have expired yet) should be killed. It seems more secure.

----- Original Message ----- From: "Tom Ptacnik" <to...@tomor.cz>
To: "symfony users" <symfony-users@googlegroups.com>
Sent: Thursday, January 28, 2010 9:57 PM
Subject: [symfony-users] Re: Making sure a login id only has one session at any moment


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.


__________ NOD32 4813 (20100128) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com

--
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.

Reply via email to