473,797 Members | 3,126 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Know who is online ?

Hi,

I would like to be able to know who is actually connected on the website i
am creating.
The users are stored in a sql server table (to enter, they have to be
identified on the login.aspx page...)

I guess i have to use application variables and global.asax, but i don't
know exactly how to do this...

Thanks !


Nov 19 '05 #1
5 1416
Hi

You would want to do something like this in your login file

After verification and session is loaded with user info

Application("To talConnected") += 1
Application("Us erNames") &= username & "," ' you need a delimiter to be
able to split later on

Then to display this info, simply split the Application("Us erNames") on ','
and you'll have a list. Don't forget to include the removal of their names
at log off:

In global.asax do something like this

On SessionEnd()
Application("To talConnected") -= 1
Application("Us erNames") =
replace(Applica tion("UserNames "),session("use rname") & ",", "") ' or
something like that

NOTE: The session end will fire when you call a session.abandon in your
logout scripts, however if a user just closes their browser, I beleive it
will take 20 minutes, or whatever the timeout is set to on the server, for
the session to expire. At this point I do not know if it will fire the
SessionEnd function. Can someone else input on this?

Enjoy!

David Lozzi
"Steph" <no_spam@no_spa m.org> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
Hi,

I would like to be able to know who is actually connected on the website i
am creating.
The users are stored in a sql server table (to enter, they have to be
identified on the login.aspx page...)

I guess i have to use application variables and global.asax, but i don't
know exactly how to do this...

Thanks !

Nov 19 '05 #2
You could keep the date/time of the last HTTP request made by a particular
user. You could then consider that those who made a request within the last
X minutes are online...

This would be my personal preference over using the session end event (that
have its own timeout, thay may not work depending on the session provider
plus perhaps not always fire for example in case of a crash).

Patrice

--

"Steph" <no_spam@no_spa m.org> a écrit dans le message de
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
Hi,

I would like to be able to know who is actually connected on the website i
am creating.
The users are stored in a sql server table (to enter, they have to be
identified on the login.aspx page...)

I guess i have to use application variables and global.asax, but i don't
know exactly how to do this...

Thanks !

Nov 19 '05 #3
Interesting, so what you're saying is collect the user's last HTTP request
and store it in the application state? So something like that would have to
be in every page to collect the information right, like in a usercontrol or
something?

--
David Lozzi
Web Applications Developer
dlozzi@(remove-this)delphi-ts.com
"Patrice" <no****@nowhere .com> wrote in message
news:uH******** ******@TK2MSFTN GP12.phx.gbl...
You could keep the date/time of the last HTTP request made by a particular
user. You could then consider that those who made a request within the
last
X minutes are online...

This would be my personal preference over using the session end event
(that
have its own timeout, thay may not work depending on the session provider
plus perhaps not always fire for example in case of a crash).

Patrice

--

"Steph" <no_spam@no_spa m.org> a écrit dans le message de
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
Hi,

I would like to be able to know who is actually connected on the website
i
am creating.
The users are stored in a sql server table (to enter, they have to be
identified on the login.aspx page...)

I guess i have to use application variables and global.asax, but i don't
know exactly how to do this...

Thanks !


Nov 19 '05 #4
one word: thanks !
++
Nov 19 '05 #5
Yes something similar (I meant of course storing just the date/time of the
last request possibly by user).

This way you'll be able :
- to consider that online users are those that made something within the
last 5 minutes (while you can still have session_end firing 20 minutes by
default after the last action)
- you could also have their names (it looks like from the question you were
interested not only in how many but also on "who" exactly)

It also depends on what is your definition of an "online" user and hows much
user you expect at the same time (you could remove from time to time expired
informations).

You should be able to do that at the beginning of each request (using
global.asax) instead of adding this explictely on each and every page.

Patrice

--

"David Lozzi" <dlozzi@(remove )delphi-ts.com> a écrit dans le message de
news:OP******** ********@TK2MSF TNGP15.phx.gbl. ..
Interesting, so what you're saying is collect the user's last HTTP request
and store it in the application state? So something like that would have to be in every page to collect the information right, like in a usercontrol or something?

--
David Lozzi
Web Applications Developer
dlozzi@(remove-this)delphi-ts.com
"Patrice" <no****@nowhere .com> wrote in message
news:uH******** ******@TK2MSFTN GP12.phx.gbl...
You could keep the date/time of the last HTTP request made by a particular user. You could then consider that those who made a request within the
last
X minutes are online...

This would be my personal preference over using the session end event
(that
have its own timeout, thay may not work depending on the session provider plus perhaps not always fire for example in case of a crash).

Patrice

--

"Steph" <no_spam@no_spa m.org> a écrit dans le message de
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
Hi,

I would like to be able to know who is actually connected on the website i
am creating.
The users are stored in a sql server table (to enter, they have to be
identified on the login.aspx page...)

I guess i have to use application variables and global.asax, but i don't know exactly how to do this...

Thanks !



Nov 19 '05 #6

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

Similar topics

2
3213
by: jack | last post by:
i want to check if a user is online or not,i mean the user use http protocol to access my site,if he close his browser ,how can i know it IMMEDIATELY??so the session can be used here ???? i found some chatroom used this technology,if possible,give me the java answer also... thanks in advance
4
1207
by: xenophon | last post by:
I have a class that is used in an ASP.NET app, a WinForms app, and a Win32 Service. What is the best way to tell what environment the code is currently instanced in? Thanks.
10
27896
by: Tim Frawley | last post by:
I am attempting to detect a Shift+Tab in the KeyPress event for back navigation on a control that doesn't support this method. Does anyone have any ideas how to compare e.KeyChar to a ShiftTab? Tim
2
1249
by: moondaddy | last post by:
I'm using WPF and c#. Whats the best way for a child class to know about it's parent class? For examle class ParentClass : CollectionBase { // code... class ChildClass { // code...
2
1796
by: smartic | last post by:
i need to know the users on line or off line, that is my code: $time = time(); $timech = time()-7; $user = $_SERVER; $session = $_SESSION; $host = "localhost"; $username = "root";
0
9685
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...
0
9536
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10468
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10205
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
10021
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
9063
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
7559
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
5458
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.