Copy link to clipboard
Copied
Hello folks!
I am trying to use a application variable which is taking a input from a Login.cfm and passing to Auth.cfm . I am not able to use this application.WebPDMReports in Auth.cfm page and not sure what in heavens I am doing wrong please if you can look into my code.
Assuming WebPDMReports and USERID are defined in application.cfm.
Login.cfm
<cfparam name="WebPDMReports" default="">
<cflock timeout=20 scope="Application" type="Exclusive">
<cfset WebPDMReports="#cflogin.name#">
</cflock>
<cflocation addtoken="no" url="../Auth.cfm">
Auth.cfm
<CFOUTPUT>
<CFLOCK SCOPE="session" TIMEOUT="30" TYPE="Exclusive">
<CFSET session.USERID=#application.WebPDMReports#> (If my session.USERID =loginuser then allows users to use index.cfm)
</CFLOCK>
</CFOUTPUT>
Please some one help me , I have wasted so much time just to make it work!!
Copy link to clipboard
Copied
what are you trying to accomplish? why are you trying to use APPLICATION variable for WebPDMReports? You know what Application scope is and its purpose, right?
Anyway, try to change <cfparam name="WebPDMReports" default=""> to <cfparam name="APPLICATION.WebPDMReports" default="">
and
<cfset WebPDMReports="#cflogin.name#"> to <cfset APPLICATION.WebPDMReports="#cflogin.name#">.
And oh, make sure your 2 cfm files are under one application name.
Still, it would be nice if you can share with us your main purpose for this certain flow of your program. Maybe we can share a better way to do it.