Skip to main content
February 21, 2009
Question

NAvigation Variables

  • February 21, 2009
  • 1 reply
  • 306 views
I have this:

<cflocation url="../programs/RACDep/racdep/bin/racdep.cfm?SupplierID=#Trim(Session.SupplierID)#&BrandID=#Session.BrandID#&SupComp=#Trim(Session.SupComp)#">


I see that variables become "undefined" even though I specificaly set them to "" (nothing)

If I do this:

<cflocation url="../programs/RACDep/racdep/bin/racdep.cfm?SupplierID=#Trim(Session.SupplierID)#&BrandID='3456','34','654','4322'&SupComp=#Trim(Session.SupComp)#">

my program works perfect.

If i dont use the cflocation and just look at the #session.brandid# it shows this:
'3456','34','654','4322'

If i copy and past this into the cflocation string (like in the first sample) It works perfect. if I use the variable (#Session.BrandID) it says its "undefined". What gives? I have been at this for 4 days. I am baffled. This "bug" is on its way to totally wreaking me

PLease please please any help would be great

G
    This topic has been closed for replies.

    1 reply

    Inspiring
    February 21, 2009
    if those are SESSION variables, why do you need to pass them in a url
    string at all??? just access them in SESSIOn scope on the page you are
    cflocating to.

    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/
    February 21, 2009
    Like the user above said, you do not need to pass session variables in the URL. The whole point of a session variable is to be able to persist over page refreshes etc. I'm not sure why you are getting the problem, but instead of passing it into the URL scope, just look for #Session.BrandID# on the resulting page.

    If you want to check if the session even exists, try this also on the resulting page:

    <cfdump var="#session#" />

    Good luck,
    Mikey.