?
Solved

Can The Coldfusion Session Scope Be Accessed from CFWindow

Posted on 2011-10-21
9
Medium Priority
?
429 Views
Last Modified: 2012-05-12
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.


0
Comment
Question by:Garbonzo_Horowitz
  • 3
  • 3
  • 3
9 Comments
 
LVL 52

Accepted Solution

by:
_agx_ earned 1000 total points
ID: 37007320
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
 
LVL 39

Assisted Solution

by:gdemaria
gdemaria earned 1000 total points
ID: 37007621

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

Author Comment

by:Garbonzo_Horowitz
ID: 37008449

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

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

 
LVL 39

Expert Comment

by:gdemaria
ID: 37008751
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
 

Author Comment

by:Garbonzo_Horowitz
ID: 37008845
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
 

Author Closing Comment

by:Garbonzo_Horowitz
ID: 37008863
Thank you.
0
 
LVL 39

Expert Comment

by:gdemaria
ID: 37008880
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
 
LVL 52

Expert Comment

by:_agx_
ID: 37009028
  > 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
 
LVL 52

Expert Comment

by:_agx_
ID: 37009063
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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

PROBLEM:  How to open a cfwindow or run a function on double click of a cfgrid row. One of my clients wanted to be able to double click on a row item to get more detailed information about a transaction and to be able to modify the line items i…
Today, I was working on some optimization and spam-stopping techniques when I encountered Ben Nadel's post to reduce spam feature using Math (http://www.bennadel.com/blog/197-How-I-Stop-Spammers-On-My-ColdFusion-Blog.htm). While this method is not o…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month15 days, 12 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question