473,790 Members | 3,200 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can we terminate a user's session

ad
In some condition, like another user log in with the some ID, I want to
close a user's session.
How can we terminate a user's session with program?
Nov 19 '05 #1
3 1996
"ad" <ad@wfes.tcc.ed u.tw> wrote in message
news:Or******** ******@TK2MSFTN GP10.phx.gbl...
In some condition, like another user log in with the some ID, I want to
close a user's session.
How can we terminate a user's session with program?


See my earlier reply about session timeout - basically, you can't...

Remember that IIS sessions are by definition independent of each other so,
unless you record each successful login in something like SQL Server, one
session can't have any knowledge about any other session.

However, if you do log each successful login, you could very simply add code
to the OnInit of each ASPX's code-behind which did something like:

if(<some condition fetched from SQL Server>)
{
Session.Abandon ();
}
Nov 19 '05 #2
ad
Thanks for your immediately answer.
But I want close specific session, not the session right now.
My scenario:
I prepare a database table (name UserOnLine) to log the User ID and Session
ID of user.

When a use login with a ID (Say User1) I check the UserOnLine table, If
there no User1 in the UserOnLine table, run the common login process.
But if the User1 ID already in UserOnLine table:
1. Fetch the SessionID of User1 in UserOnLine table.
2. Abandon the Session of that SessionID
3. Process common login process.

My question is :
1. How to get the session ID when a user login?
2. How can we abandon a specific session?

"Mark Rae" <ma**@mark-N-O-S-P-A-M-rae.co.uk> ¼¶¼g©ó¶l¥ó·s»D: eN************* *@TK2MSFTNGP09. phx.gbl...
"ad" <ad@wfes.tcc.ed u.tw> wrote in message
news:Or******** ******@TK2MSFTN GP10.phx.gbl...
In some condition, like another user log in with the some ID, I want to
close a user's session.
How can we terminate a user's session with program?


See my earlier reply about session timeout - basically, you can't...

Remember that IIS sessions are by definition independent of each other so,
unless you record each successful login in something like SQL Server, one
session can't have any knowledge about any other session.

However, if you do log each successful login, you could very simply add
code to the OnInit of each ASPX's code-behind which did something like:

if(<some condition fetched from SQL Server>)
{
Session.Abandon ();
}

Nov 19 '05 #3
"ad" <ad@wfes.tcc.ed u.tw> wrote in message
news:Oq******** ******@TK2MSFTN GP10.phx.gbl...
1. How to get the session ID when a user login?
HttpContext.Cur rent.Session.Se ssionI
2. How can we abandon a specific session?


Don't even try - rethink your application design...
Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1987
by: Roberto Kohler | last post by:
Is there a way for an administrator to terminate ASP sessions if I know the ASP Session IDs that I want to terminate? Session.Abandon only works on the caller's session. Is there something like Session.Kill(SessionID) ?
3
2472
by: Kathy Burke | last post by:
Hi, I'm tired, so this question may be silly. I have a fairly long sub procedure. Based on one condition, I load another sub with the following: If Session("GRN") = "complete" Then txtScan.Text = Session("SN") txtScan_TextChanged(sender, e) Session("GRN") = "" Exit Sub End If
1
1608
by: lucas | last post by:
Hi, is there a way to terminate a user session? I created a web service that loops trough a database that contains emails and sends a personnaly adressed email to everyone. The web service is void (dosn't return anything to the caller). I use a web form to create the email with attachments and pass the email as a parameter to the web service. The client I'm doing this for has a little over 8000 emails in the database so I make the...
1
1657
by: islandfong | last post by:
I have a list of job scheduled to be executed in sequence with Oracle 10g. Each of these jobs could take quite a long time to run. Eventually user may decide to terminate the execution of the job in the middle. I don't want this termination action to impact the other jobs scheduled. Can I use 1 session for each job executed and terminate the session when user wants to terminate the job? If yes, I will have many sessions for these jobs in the...
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10147
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9987
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9023
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7531
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6770
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5552
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4100
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3709
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.