473,473 Members | 1,563 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Determine users currently logged in

I need to implement an option to display on the web page for users currently
logged in. How do I implement this in ASP.NET (c#).

I could probably have a boolean field in the database where a user can be
set as logged. This can easily be done in the code-behind. The problem is
how do I "unlogged" the user when the session is timed out?
Jun 27 '08 #1
5 1890
"Benedictum" <Be********@dominusvobis.comwrote in message
news:ua**************@TK2MSFTNGP02.phx.gbl...
I need to implement an option to display on the web page for users
currently logged in. How do I implement this in ASP.NET (c#).
How are you managing logins...?
I could probably have a boolean field in the database where a user can be
set as logged. This can easily be done in the code-behind. The problem is
how do I "unlogged" the user when the session is timed out?
If you're using inproc sessions, you can write code in the Session_End
event...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jun 27 '08 #2
The registered users are authenticated against a datafile. Particulars are
kept in a a seesion var.

Can you show me a code snippet or direct me a tutorial on how to go about
this?
Thanks.

"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:eP**************@TK2MSFTNGP05.phx.gbl...
"Benedictum" <Be********@dominusvobis.comwrote in message
news:ua**************@TK2MSFTNGP02.phx.gbl...
>I need to implement an option to display on the web page for users
currently logged in. How do I implement this in ASP.NET (c#).

How are you managing logins...?
>I could probably have a boolean field in the database where a user can be
set as logged. This can easily be done in the code-behind. The problem is
how do I "unlogged" the user when the session is timed out?

If you're using inproc sessions, you can write code in the Session_End
event...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jun 27 '08 #3
"Benedictum" <Be********@dominusvobis.comwrote in message
news:eT**************@TK2MSFTNGP03.phx.gbl...

[top-posting corrected]
>>I need to implement an option to display on the web page for users
currently logged in. How do I implement this in ASP.NET (c#).

How are you managing logins...?
>>I could probably have a boolean field in the database where a user can
be set as logged. This can easily be done in the code-behind. The
problem is how do I "unlogged" the user when the session is timed out?

If you're using inproc sessions, you can write code in the Session_End
event...

The registered users are authenticated against a datafile. Particulars are
kept in a a session variable.
OK, so when a user logs out, remove them from the session variable.

And, when a session times out, remove the user from the session variable
through the Session_End code in global.asax.
http://www.google.co.uk/search?sourc...+Session%5fEnd
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jun 27 '08 #4
What happens then when the user just closes the browser? How do handle this?

"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:ey**************@TK2MSFTNGP04.phx.gbl...
"Benedictum" <Be********@dominusvobis.comwrote in message
news:eT**************@TK2MSFTNGP03.phx.gbl...

[top-posting corrected]
>>>I need to implement an option to display on the web page for users
currently logged in. How do I implement this in ASP.NET (c#).

How are you managing logins...?

I could probably have a boolean field in the database where a user can
be set as logged. This can easily be done in the code-behind. The
problem is how do I "unlogged" the user when the session is timed out?

If you're using inproc sessions, you can write code in the Session_End
event...

The registered users are authenticated against a datafile. Particulars
are kept in a a session variable.

OK, so when a user logs out, remove them from the session variable.

And, when a session times out, remove the user from the session variable
through the Session_End code in global.asax.
http://www.google.co.uk/search?sourc...+Session%5fEnd
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jun 27 '08 #5
"Benedictum" <Be********@dominusvobis.comwrote in message
news:u5**************@TK2MSFTNGP05.phx.gbl...

[top-posting corrected again]
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:ey**************@TK2MSFTNGP04.phx.gbl...
>"Benedictum" <Be********@dominusvobis.comwrote in message
news:eT**************@TK2MSFTNGP03.phx.gbl...

[top-posting corrected]
>>>>I need to implement an option to display on the web page for users
currently logged in. How do I implement this in ASP.NET (c#).

How are you managing logins...?

I could probably have a boolean field in the database where a user can
be set as logged. This can easily be done in the code-behind. The
problem is how do I "unlogged" the user when the session is timed out?

If you're using inproc sessions, you can write code in the Session_End
event...

The registered users are authenticated against a datafile. Particulars
are kept in a a session variable.

OK, so when a user logs out, remove them from the session variable.

And, when a session times out, remove the user from the session variable
through the Session_End code in global.asax.
http://www.google.co.uk/search?sourc...+Session%5fEnd

What happens then when the user just closes the browser?
Nothing, as far as the webserver is concerned. That's the nature of the
disconnected architecture of the web.
How do handle this?
You can't...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jun 27 '08 #6

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

Similar topics

4
by: vesely | last post by:
Hi all, I'm currently relying on logged-in users hitting "logout" (logoff) before they leave, in order to terminate the session. With PHP the session filename is in a cookie that lasts for the...
2
by: RickPowell | last post by:
I wrote a VB .NET Service to restart the computer when certain business rules are triggered (such as not being rebooted in x days, no users logged on, time is 1-3 am, etc.). I am currently using...
1
by: Marcin Zmyslowski | last post by:
Hello all! I want to create a page in ASP language which gives me information about currently logged users. I thought to do it by this way: when somebody will log in to page, there will be a...
2
by: Lauren Quantrell | last post by:
In my MS Access2000 MDB Files I used the code below to populate a list box of all logged on users. Can anyone help me figure out a way to modify the code to do the same with my MS Access2000 ADP...
3
by: Arvind R | last post by:
Hello, how to display on the particular page where the list of users currently logged in and total no of users currently logged in? any sample code or apps? --
0
by: Marty Cruise | last post by:
I have a Windows Forms application that accesses an SQL Server DB. I would like to show a 'Messenger-like' listing of all users, and which of them are currently logged in to the system. How can I...
40
by: Jeff | last post by:
I have a system on a network and want to determine if anyone is currently connected to the back-end files. An interesting twist is that I have noticed that some users can be connected (have the...
3
by: iwdu15 | last post by:
hi, im writing a program that will get all currently logged on users to my LAN. so far i can only egt all users, logged on or not, using the WMI Searcher object...ive looked on the MSDN website for...
8
by: Mike P | last post by:
What would be the best way of counting the number of users who are currently logged on to a website? I am making the users login against a database of valid users. Would the best way be to add a...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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,...
1
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
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.