Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / April 2007



Tip: Looking for answers? Try searching our database.

User management

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Irish-Phoenix - 28 Apr 2007 23:12 GMT
I have a section in my web site that you need to log into. I am trying to
create a tag that tells you, when you log in on the page that you log onto,
what users are online. Like this:

User:
Phoenix is logged in

How do I do this?
I need it to also disengae once the user logs out.

Can anyone help me out?
Thank you.

Phoenix
craigkaminsky - 29 Apr 2007 17:22 GMT
Off-hand, I can envision one (probably old-schoolish) approach:
Hold the user's online/offline status in the database table you use to manage
their accounts.
When a user logs in, tick their record in the database to indicate they are
online (isOnline=1).
When the user logs out, change the value back to "off" (isOnline=0). You could
also (depending on what version of CFMX you have the approach would be
different) set this value to change automatically when the session ends/times
out (see OnSessionEnd --
http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhel
p.htm?context=ColdFusion_Documentation&file=00000701.htm).

To display who's online, you could employ some fairly basic Ajax code to call
a CFM template, query who's on and return the data to the Ajax script, which
would output the data to the screen (too much code to type here for an example,
but check out: http://www.w3schools.com/ajax/default.asp for some basic
tutorials (apologies if this is below your skills...not sure what you may/may
not know about Ajax but wanted to include it just in case). Also, check out
ajaxCFC for implementing Ajax in CF apps faster (http://ajaxcfc.riaforge.org/).

One other thing I'd be interested in hearing about (if it applies) is how
event gateways in CFMX 7 might be able to help here. Event gateways are on my
list of things to learn still and might not apply here but I'd be interested to
know if they did.

Anyway, hope this helps get you started...

Cheers.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.