sorry, didn't make sense first time I read it, but now I see. Yep, that's excellent. I'll just make a struct on the application scope to hold the IDs of all the currently logged in users and validate against it whenever there is a new login.
Is there any way for something to go wrong with the users session, so that they don't get logged out properly? If that happened they might need to login again, but couldn't because the struct would say that ID is still logged in.
Main Topics
Browse All Topics





by: azadisaryevPosted on 2009-06-24 at 03:31:26ID: 24699735
in onApplicationStart() event in your Application.cfc (your are using Application.cfc vs Application.cfm, right? you have evolved into the 21 century, i hope) create a structure in application scope (i.e. <cfset Application.usersloggedin = {}>) to store currently logged in users (i.e. either their user id, or username/passowrd).
then in you cflogin procedure check that structure to see if the user is already logged in. if the user is found in the structure, show an error message. if not - save add the user id to that structure and log the user in.
Azadi