Listing 1: Application code <cfapplication name="my_company" applicationtimeout=#CreateTimeSpan(0, 2, 0, 0)# clientmanagement = "yes" clientstorage="cookie" setclientcookies = "yes" setdomaincookies = "no" sessionManagement = "yes" sessionTimeout=#CreateTimeSpan(0,0,20,0)# loginstorage="cookie" scriptProtect = "all"> <!--- **** Line-by-line explanation **** 1. The application's name is my_company; it times out in 2 days. 2. Client variables are enabled; they are stored as a cookies on the user's browser; they SHOULD be stored in a data source but I get an error every time this happens (this is a separate problem; see above) 2a.On the client side, client variables are set in users' browsers as cookies; they should not be, but passing CFID and CFTOKEN data manually through links is not working (another problem; I guess I'll ask about it later) 3. Setdomaincookies is only meaningful for a clustered environment and is turned off. 4. Session variables are enabled for login; they time out in 20 minutes; login storage is handled in cookies. (I left this as the default, taking my cue from Ben Nadel, whose blog is really good: http://www.bennadel.com/blog/726-ColdFusion-Application-cfc-Tutorial-And-Application-cfc-Reference.htm . Ben says: "I have never used [loginstorage], so I am not exactly sure what that means. Defaults to cookie." I know that by setting cookie here I am giving up my goal of enabling logins for users without cookies, but I am willing to work with that for now--I wanted to leave this as is to not rock the boat with the MAIN problem.) 5. Built-in XSS protection is turned on ---> Listing 2: simple test code <!--- if you didn't set the dummy client variable ---> <cfif NOT isDefined("CLIENT.dummy")> <!--- set it (inside a lock, to be safe) ---> <cflock timeout=20 scope="CLIENT" type="Exclusive"> <cfset CLIENT.dummy = 1> </cflock> <!--- output that you've set it ---> client var set<br> <cfdump var="#CLIENT#"><br> <!--- if you DID set it ---> <cfelse> <!--- output it ---> <cfdump var="#CLIENT#"><br> client var output<br> </cfif>
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE