@BKBK, Here is my Application.cfm It worked perfectly in CF9 for many year. <cfcomponent> <cfset THIS.name="PROD"> <cfset THIS.sessionManagement="true"> <cfset THIS.clientManagement="true"> <cfset THIS.setClientCookies="true"> <cfset THIS.applicationTimeout=CreateTimeSpan(1,0,0,0)> <cfset THIS.sessionTimeout=CreateTimeSpan(0,0,20,0)> <cffunction name="onApplicationStart"> </cffunction> <cffunction name="onApplicationEnd"> </cffunction> <cffunction name="onSessionStart"> <cftry> <cfif find("SPI\",#CGI.Auth_User#)> <cfset curr_user = listlast(#CGI.Auth_User#,"SPI\")> <cfset SESSION.curr_user = UCase(curr_user)> <cfelse> user not found !!! <cfabort> </cfif> <cfquery name="get_roles" datasource="#REQUEST.dsn#"> query goes here ... </cfquery> <cfif get_roles.RecordCount GT 0> <cfset rolesArray=ArrayNew(1)> <cfloop query="get_roles"> <cfset rolesArray[CurrentRow] = "/" & link_home[CurrentRow] & "/"> </cfloop> <cfset SESSION.userRoles = rolesArray> </cfif> <cfcatch> onSessionStart Error <cfdump var="#cfcatch#"> <cfabort> </cfcatch> </cftry> </cffunction> <cffunction name="onRequestStart"> <cfif not structKeyExists(session,"curr_user")> <!--- The session has been lost, restart it... ---> <cfset onSessionStart() /> </cfif> <cfif NOT isDefined("URL.contentonly")> <table width="100%" border="0" bgcolor=""> <tr align="center"> <td><img src="\prod\IMAGES\logo.jpg" width="886" height="87" border="0"></td> <td class="TH">Welcome <cfoutput>#session.curr_user#</cfoutput><br></td> </tr> </table> <hr size="3"> </cfif> <cftry> <cfif not structKeyExists(session, "curr_user")> You are not a valid user. <cfabort> </cfif> <!--- Check if userRoles exist in SESSION ---> <cfif not structKeyExists(session, "userRoles")> You have no roles assigned.<br> Please contact your web administrator. <cfabort> </cfif> <!--- Get the name of the current template (from where request is coming from) ---> <cfset currentPage = listLast(cgi.script_name,"/") /> <cfset SESSION.curr_page = currentPage> <cfif not listfindNoCase("index.cfm,login.cfm,logout.cfm", currentPage)> <cfset userRoles = SESSION.userRoles> <cfset foundit = true> <cfset i = 0> <cfloop condition = "(NOT foundit) AND (i LT ArrayLen(userRoles))"> <cfset i = i + 1> <cfif find(#userRoles#,#currentPage#)> <cfset foundit = True> </cfif> </cfloop> <cfif not foundit> You do not have permission to view this page <cfabort> </cfif> </cfif> <cfcatch> <cfdump var="#cfcatch#"> <cfabort> </cfcatch> </cftry> </cffunction> <cffunction name="onRequestEnd"> <cfif NOT isDefined("URL.contentonly")> <p align="right"> <cfoutput> <font size="2" face="sans-serif" color="black"> <i>©#Year(Now())#</i><BR> </cfoutput> </p> </cfif> </cffunction> <cffunction name="onSessionEnd"> </cffunction> <cffunction name="onError" returnType="void" output="true"> <cfargument name="exception" required="true"> <cfargument name="eventname" type="string" required="true"> <cfset var errortext = ""> <!--- Display error to user ---> <img src="../../IMAGES/SiteError.gif" width="750" height="150" alt="Site Error" border="0"> <p></p> Error: <cfoutput><strong>#arguments.exception.message#</strong></cfoutput><br /> Error details were sent to the application administrator.<br /> <p></p> <a href="<cfoutput>#CGI.http_referer#</cfoutput>">Go Back</a> <cfsavecontent variable="errortext"> <cfoutput> Time: #dateFormat(now(), "short")# #timeFormat(now(), "short")#<br /> Error on page: http://#cgi.server_name##cgi.script_name#?#cgi.query_string#<br /> Referrer: #cgi.HTTP_REFERER# </cfoutput> <cfdump var="#arguments.exception#" label="Error"> </cfsavecontent> <cfmail to="me@company.com" from="cf@company.com" subject="ColdFusion request failed for #UCase(listlast(SESSION.curr_user,"\"))#" type="html"> #errortext# </cfmail> </cffunction> </cfcomponent>
... View more