September 06, 2008
For ColdFusion hosting try HostMySite.com. |
Home /
Groups /
ColdFusion Talk (CF-Talk)
Why would this generate an error?
Sorry bout the lame post minus all the code, but everytime I post it, it never posts.Will Tomlinson 07/18/06 06:18 A > <cfif NOT IsDefined("SESSION.auth.isLoggedIn")>Tom Chiverton 07/18/06 06:40 A CFLocation fires the onError function (I believe). Are you using aBen Nadel 07/18/06 07:59 A >CFLocation fires the onError function (I believe). Are you using aWill Tomlinson 07/18/06 03:39 P Why the include/abort? Maybe something like this (untested)...Cutter (CFRelated) 07/18/06 02:20 P
Author: Will Tomlinson
Sorry bout the lame post minus all the code, but everytime I post it, it never posts. lol Anyway, I have an Application.cfc in an admin folder... it extends the rootApplication.cfc. In the admin folder App.cfc I'm using onRequestStart() to restrict access. <cffunction name="onRequestStart" returntype="void" output="false"> <cfif NOT IsDefined("SESSION.auth.isLoggedIn")> <cfinclude template="login.cfm"> <cfabort> </cfif> <cfif IsDefined("URL.logout")> <cfset StructDelete(SESSION,"auth")> <cflocation url="login.cfm"> </cfif> </cffunction> In my root Application.cfc, I'm using onError(). The problem is, if you simply login to the admin folder, an error is thrown. You never see anything wrong when you go thru login, onError() just fires off. I can't figure out why an error would be generated from loggin in like this. Thanks, Will
Author: Tom Chiverton
> <cfif NOT IsDefined("SESSION.auth.isLoggedIn")> Are you sure session.auth will always exist ? -- Tom Chiverton **************************************************** This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at St James's Court Brown Street Manchester M2 2JF. A list of members is available for inspection at the registered office. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law Society. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 8008. For more information about Halliwells LLP visit www.halliwells.com.
Author: Ben Nadel
CFLocation fires the onError function (I believe). Are you using a CFLocation after they Log into the system? I put this in my onError() method (original idea by Ray Camden): <!--- CFLocation will cause an error for no reason in the event model. If that happens, the exceptions type will be Aport Exception. Just return out if that is the case. ---> <cfif NOT CompareNoCase( ARGUMENTS.Exception.RootCause.Type, "coldfusion.runtime.AbortException" )> <cfreturn /> </cfif> ...................... Ben Nadel www.bennadel.com Sorry bout the lame post minus all the code, but everytime I post it, it never posts. lol Anyway, I have an Application.cfc in an admin folder... it extends the rootApplication.cfc. In the admin folder App.cfc I'm using onRequestStart() to restrict access. <cffunction name="onRequestStart" returntype="void" output="false"> <cfif NOT IsDefined("SESSION.auth.isLoggedIn")> <cfinclude template="login.cfm"> <cfabort> </cfif> <cfif IsDefined("URL.logout")> <cfset StructDelete(SESSION,"auth")> <cflocation url="login.cfm"> </cfif> </cffunction> In my root Application.cfc, I'm using onError(). The problem is, if you simply login to the admin folder, an error is thrown. You never see anything wrong when you go thru login, onError() just fires off. I can't figure out why an error would be generated from loggin in like this. Thanks, Will
Author: Will Tomlinson
>CFLocation fires the onError function (I believe). Are you using a >CFLocation after they Log into the system? I tried posting again after the first one but it wouldn't come thru. It actually throws the error when you just hit the login page. You don't even hafta login. Lemme try some of these ideas that've been posted. Thanks, Will
Author: Cutter (CFRelated)
Why the include/abort? Maybe something like this (untested)... <cffunction name="onRequestStart" returntype="void" output="false"> <cfif not structkeyexists(session.auth,"isLoggedIn")> <cfif structkeyexists(url,"logout")> <cfset structdelete(session,"auth") /> </cfif> <cflocation url="login.cfm" /> </cfif> </cffunction> Cutter __________ http://blog.cutterscrossing.com Will Tomlinson wrote:
|
Mailing Lists
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||