I had always followed the same practice as you until I saw this done in an CFDJ article and thought it was a pretty slick way to a handle the whole login process. Is there any reason that anyone has about why it should not be done this way?
-----Original Message----- From: Tyler M. Fitch [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 20, 2001 6:11 PM To: CF-Talk Subject: RE: CFLOCK and CFLOCATION Ahh, Yeah I understand that. The only hit against that would be having the HTML code in your App.cfm. I do not know what the majority opinion of the CF developers, but we do not tend to have any HTML in the App.cfm - just define our vars - datasource, image paths, upload locations etc. Okay, gotta run and catch the bus now. t ********************************************************************** Tyler M. Fitch Certified Advanced ColdFusion 5 Developer ISITE Design, Inc. 615 SW Broadway Ste. 200 Portland, OR 97205 503.221.9860 ext. 111 http://isitedesign.com ********************************************************************** -----Original Message----- From: Keen [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 20, 2001 6:01 PM To: CF-Talk Subject: RE: CFLOCK and CFLOCATION Tyler No I think you misunderstood what I said. There would be no login.cfm ... the code is in the application.cfm You check for a session.userid, if it does not exist you then check for the existence of the form.login (the login form code is actually contained in the application.cfm). If the form.login exist you check for a valid login. If the form.login does not exist then the login form is displayed to the user. It works very nicely. I can send you the code if you would like to see how I do it. Keen -----Original Message----- From: Tyler M. Fitch [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 20, 2001 5:48 PM To: CF-Talk Subject: RE: CFLOCK and CFLOCATION That won't work out because if that code is in the Application.cfm it will produce an endless loop. The session isn't defined so go to login.cfm - when login.cfm loads it also loads the Application.cfm - the session isn't defined so go to the login.cfm - and so on. HTH, t ********************************************************************** Tyler M. Fitch Certified Advanced ColdFusion 5 Developer ISITE Design, Inc. 615 SW Broadway Ste. 200 Portland, OR 97205 503.221.9860 ext. 111 http://isitedesign.com ********************************************************************** -----Original Message----- From: Keen [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 20, 2001 5:29 PM To: CF-Talk Subject: RE: CFLOCK and CFLOCATION Is the code below from the application.cfm? If so instead of using a cflocation why not just put the login logic as part of the application.cfm? If the session.userid does not exist the login logic is executed and if it exist the login logic is ignored. -----Original Message----- From: Jim McAtee [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 20, 2001 3:43 PM To: CF-Talk Subject: CFLOCK and CFLOCATION Is it OK to do a <cflocation url="..."> from within a cflock? As in: <cflock type="readonly" scope="session" timeout="5" throwontimeout="no"> <cfif not IsDefined("session.userid")> <cflocation url="login.cfm"> </cfif> </cflock> Or does this leave the lock in place? If that's so, would the recommended workaround be to copy the session variable to a variables or request scope variable, something like this? <cflock type="exclusive" scope="session" timeout="5" throwontimeout="yes"> <cfparam name="session.userid" default="0"> <cfset request.userid = session.userid> </cflock> <cfparam name="request.userid" default="0"> <cfif request.userid eq 0> <cflocation url="login.cfm"> </cfif> Jim ______________________________________________________________________ Get Your Own Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists