Groups | Blog | Home
all groups > asp.net > september 2005 >

asp.net : A way to kill Session user(only one session), solutions...


Marina
9/6/2005 3:53:04 PM
Handle the Session_End routine, and in it, delete the database row for the
session that is ending. This event will fire when the session idle timeout
is reached.

[quoted text, click to view]

Lucas Tam
9/6/2005 7:25:49 PM
"Fabrice" <emouchet@spam-infonie.fr> wrote in
news:#nU5PUxsFHA.1168@TK2MSFTNGP11.phx.gbl:

[quoted text, click to view]

I don't think you can kill other sessions...

Well perhaps if you were using SQL Server as a state server you can... but
if it's inprocess, I don't believe this is possible.

A better solution would be to ingore the session (let it expire naturally),
and just your database to track the status of the users.

--
Lucas Tam (REMOVEnntp@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.

Fabrice
9/6/2005 8:59:07 PM
Hello,

I 'would like to build a system (based on database, not SqlServer but MySQL)
to permit only one session per user. I'm using a form athentication.

My Solution :
---------------

When a connection is established by a user, I realize an insert in a Table,
named tbLogin with many informations such as idUser, SessionId, Guid, Date,
Time..

So, if an another user try a connexion with same Login And Password, ...he
can't. The record of a connection exist in my table tbLogin and the access
is refused.
This solution is fine so long as users use the button Exit of my Application
Web.
By this way I can delete the line in the table tbLogin and allow another
access. To identify the right line (unique), i use the SessionID delivred by
the framework.

My problem
---------------

But the problem is when the user don't use this button or let the session to
expire....
How to kill this line in my table after a certain time and allow a new
connection.
I'have an idea, ...to allow an access in force. That is to say a connection
which first delete this line in Tblogin and after allow access and insert a
new line.
But in this case I'd like to remove all the session variable bind to the
specific SessionID before the deleting. That is to say, kill the session of
the user. By this way i'm sure that there is only one session by usser.


So, how to access or remove the session variables bind to a specific User
when you know this sessionID. Is it possible ? A kind of kill session like
in Oracle Database (alter kill session ...)
Or perhaps do you know a best solution ?


Thanks for your help and your time.

fabrice

AddThis Social Bookmark Button