awesomebeats
Technical User
Alright, ya'll are going to love this one. I want to have an array that tells what users are logged in and out of my application at any given moment, so that I can eventually prevent multiple logins (yes I’m still on this same problem). I think from what I’ve been told I need to use an application level array (application.array), I’m guessing. Easy enough! When a user logs in I simple add a row to the array with their info and when the log out delete that row. I know how to do that much. Here though are my questions. Firstly, is there a way to have it where when a user closes their browser it automatically clears their row from the array? I have some code (posted below) I use to clear session variables when a user closes their browser. Could I link their row in the array with a session variables that gets cleared when the browser closes, so that their row clears? I don’t have to do it that way just a suggestion I don’t know how to follow up on. Anyway to get the user’s row of the array to clear when the exit their browser is needed. Also this I know is possible. If I have an array how can I query it? Like can I dynamically select the row where user x’s info is placed. That’s about it thank you for your help. I really need it!
awesomebeats
<cfif IsDefined("Cookie.CFID"
AND IsDefined("Cookie.CFTOKEN"
>
<cfset localcfid = Cookie.CFID>
<cfset localcftoken = Cookie.CFTOKEN>
<cfcookie name="CFID" value="#localcfid#">
<cfcookie name="CFTOKEN" value="#localcftoken#">
</cfif>
awesomebeats
<cfif IsDefined("Cookie.CFID"
<cfset localcfid = Cookie.CFID>
<cfset localcftoken = Cookie.CFTOKEN>
<cfcookie name="CFID" value="#localcfid#">
<cfcookie name="CFTOKEN" value="#localcftoken#">
</cfif>