• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

User management

Contributor ,
Apr 28, 2007 Apr 28, 2007

Copy link to clipboard

Copied

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
TOPICS
Advanced techniques

Views

164

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Apr 29, 2007 Apr 29, 2007

Copy link to clipboard

Copied

LATEST
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/wwhelp.htm?context=ColdFu...

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation