Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Application variable help please!

New Here ,
Jun 22, 2009 Jun 22, 2009

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!!

652
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 23, 2009 Jun 23, 2009
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources