Yii Framework Forum: Kill user session - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Kill user session Rate Topic: -----

#1 User is offline   manilodisan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 80
  • Joined: 17-September 09
  • Location:Bucharest

Posted 10 October 2009 - 11:13 PM

I want to allow admins to kill user sessions. I have a page where I display the online users so I need to implement something that allows them to kill a user's session. I keep the session data in the database currently and I tried with
Yii::app()->session->destroySession ( $_GET [ 'id' ] );


where $_GET [ 'id' ] is the session id but that doesn't do anything since the session data is recreated in the db. How do I logout a user knowing his session id?
0

#2 User is offline   Ismael 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 163
  • Joined: 02-June 09
  • Location:Brazil

Posted 11 October 2009 - 07:55 AM

This is a PHP issue i think.

Each user logged receive their own $_SESSION variable. None can access it.

But, if the $_SESSION back-end is controlled in data base you'll be able to access it.
2

#3 User is offline   manilodisan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 80
  • Joined: 17-September 09
  • Location:Bucharest

Posted 11 October 2009 - 11:02 AM

View PostIsmael, on 11 October 2009 - 07:55 AM, said:

This is a PHP issue i think.

Each user logged receive their own $_SESSION variable. None can access it.

But, if the $_SESSION back-end is controlled in data base you'll be able to access it.

Highly irrelevant. I'm not here to learn about sessions. Let's stick do CDbHttpSession and it's functionality.
-6

#4 User is offline   Ismael 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 163
  • Joined: 02-June 09
  • Location:Brazil

Posted 14 October 2009 - 08:44 AM

View Postmanilodisan, on 11 October 2009 - 11:02 AM, said:

Highly irrelevant. I'm not here to learn about sessions. Let's stick do CDbHttpSession and it's functionality.


You can't kill another user session because you can't access it. Only access yours.

Too achieve this with CDbHttpSession you should put some flag to check.
$user->amIKilled = true;

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users