Can The Coldfusion Session Scope Be Accessed from CFWindow

Is there any reason why I can't access the SESSION and APPLICATION scope from within CFWindow?

I've got this on a page:

<img src="images/myPic.gif" border="0"
   onclick="ColdFusion.Window.create('myWindow+#uniqueid#','Alert!','http://www.mysite.com/model/WindowData.cfm?userID=#Uniqueid#',{x:100,y:100,height:300,width:400,modal:true,closable:false,draggable:false,resizable:false,center:true,_cf_refreshOnShow:true})" />

Then on WindowData.cfm no SESSION and APPLICATION variables can be accessed.

Is this appopriate behaviour for CFWindow or am I just nuts? I don't see a reason why I shouldn't access these scopes.


Garbonzo_HorowitzAsked:
Who is Participating?
 
_agx_Commented:
Nope. As long as the page you're opening is covered by your Application.cfc/cfm there's shouldn't be any reason you can't access session/application variables. Are you getting an error?
0
 
gdemariaCommented:

....  is the URL you're opening part of the same domain?

You can try using a relative reference ....

....'Alert!','/model/WindowData.cfm?userID=#Uniqueid#', .....
0
 
Garbonzo_HorowitzAuthor Commented:

@ agx

I get this error message from the WindowData page:
Variable SESSION is undefined.
Variable APPLICATION is undefined.
Whenever I dump those vars on the page.

 @ gdemaria

I changed the code to use a relative reference but I still get the APPLICATION undefined error.



I can dump the session and application scope on the page that contains the WindowCreate and it shows up just fine but when I try it on the WindowData page it does not recognize those scopes.

The framework that I'm using is a modified Fusebox where all pages go through a main ciruct. That really shouldn't matter though.

0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
gdemariaCommented:
what happens if you try to SET a session variable, do you get an error?

<cfset session.myTest = "123">

...

 is there any chance of a 2nd application.cfc or .cfm file in your directories?

0
 
Garbonzo_HorowitzAuthor Commented:
It turns out that the issue was framwork related.
Thats what you get when working with a roll-your-own framwork.
Since the WidnowData page was not passing through the main circut none of the setup was being done.

Both of the responses were accurate and useful so I'm splitting the points for both.



0
 
Garbonzo_HorowitzAuthor Commented:
Thank you.
0
 
gdemariaCommented:
Sure, glad you figured it out.

But it seems if your application file is in your root, then it wouldn't matter where the file was ...   you may want to be sure your application file is in the root..
0
 
_agx_Commented:
  > But it seems if your application file is in your root, then it wouldn't matter where the file was ...  

Yeah, that's what I was thinking.  Unless maybe this "setup" code is done inside the main circuit and not inside the Application.cfc/cfc file ...?
0
 
_agx_Commented:
Wait scratch that ... even if some variables were being set inside the main circuit, the base scopes (application, session) would still be available. ie You'd get a different error.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.