If you use client variables and use the db as storage you could use SELECT COUNT(*) AS userLoggedIn FROM CGLOBAL WHERE (DATEDIFF(minute, lvisit, GETDATE()) <= 30)
Where 30 is time (minutes) that a session is valid on your site! This will return the number of clients logged-in, offcourse they could have left your site in the mean time, but I asusme you are not really looking for a 100% accurate count.. Hope it helps, Taco Fleur ----- Original Message ----- From: <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Tuesday, February 04, 2003 6:48 PM Subject: CF Logins and Users Logged In > Hi > > Does anybody on the list know how I can implement a feature on my Intranet site thats shows how many users are currently logged. > > I.E. There are currently 5 users on the site. > > Any ideas on how to implement this ? This is what I have at the moment ...... > > The user enters their username/password to log into the Intranet - this checks against the database below > > > <CFQUERY DATASOURCE="#Application.DSN#" NAME="entry"> > > SELECT * > > FROM usersetup > > WHERE Username = '#form.Username#' AND Password = '#form.Password#' > > </CFQUERY> > > > > If correct session variables are created and you enter the homepage. > > > > <CFSET Session.Password = "#Security.Password#"> > > <CFSET Session.Username = "#Security.username#"> > > <CFSET Session.forename = "#Security.foreName#"> > > <CFSET Session.surname = "#Security.surName#"> > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4