4 Replies Latest reply on Jun 29, 2016 6:11 AM by WolfShade

    Dynamically Creating Application Variables

    KomputerMan.com Level 1

      Disclaimer...  I didn't write this stuff!!!  I'm just trying to understand WHY somebody wrote this stuff!!!

       

      I'm going through one of the Application.cfc templates I'm supposed to be responsible for when I ran across something I just didn't get.  OK So I've ran across a bunch of stuff I don't get but that isn't the point... 

       

      Turns out EVERY time a visitor hits this internal application the system generates a whole new set of Application variables for them.  The first few lines of the Application.cfc file are shown here:

       

      <cfcomponent>
        <cfset this.name = "rover_" & lCase(ListLast(cgi.auth_user,"\"))> 
      

       

      This means every unique visitor will create an application called "rover_SomeNameGoesHere".  It also means the onApplicationStart method will be getting executed once for each unique visitor.

       

      Can anybody think of a "valid" reason for creating a new application scope for every unique visitor?  Because it's an internal app we never see more than 20 unique applications running at any one moment in time.  Even though the number is pretty low I don't understand why anybody would want to create 20 or so applications when 1 will do...  Any insight would be appreciated because I just don't get it...