Skip to main content
March 23, 2010
Question

Coldfusion cookies - FireFox Browser Problems

  • March 23, 2010
  • 1 reply
  • 1210 views

Hi,

I have an app that works great in MSIE 6, 7, & 8 as well as Google Chrome.

However it doesn't work in Firefox and for the following reason. Since my new apps are built in Flex 3 I need to use cookies (because the CFC invoked from the Flex app doesn't carry over the session variables so I need to make every session variable a cookie as well). I found that new versions of IE were causing timeout issues b/c the cookies kept expiring. Long story short I found a fix (but in doing so Firefox users cannot access the app). This code is included in the Application.cfc in the OnRequestStart function (so that throughout every page request... if the cookies don't exist for whatever reason then make them based off of the session ones):

<cffunction name="OnRequestStart">

<cfif isdefined("session.toporg") and not isdefined("cookie.TopOrg")>

   <cfset cookie.uid = session.uid>
            <cfset cookie.givenname = session.givenname>
            <cfset cookie.sn = session.sn>
            <cfset cookie.mail = session.mail>
            <cfset cookie.title = session.title>
            <cfset cookie.ptcmanagerid = session.ptcmanagerid>
            <cfset cookie.employeenumber = session.employeenumber>
            <cfset cookie.ptcdepartmentglnum = session.ptcdepartmentglnum>               
            <cfset cookie.ptcdivision = session.ptcdivision>
            <cfset cookie.ptcplinkorg = session.ptcplinkorg>       
            <cfset cookie.ptcunit = session.ptcunit>       
            <cfset cookie.ptcjobrole = session.ptcjobrole>       
            <cfset cookie.ptcorg = session.ptcorg>                                
            <cfset cookie.SELECTED_Top_MGR_ID = session.SELECTED_Top_MGR_ID>
            <cfset cookie.Top_MGR_IDS = session.Top_MGR_IDS>
            <cfset cookie.view_budgets = session.view_budgets>
            <cfset cookie.TopOrg = session.TopOrg>
            <cfset cookie.Org = session.Org>
            <cfset cookie.j_fam = session.j_fam>    
            <cfset cookie.allowed_ids = session.allowed_ids>

</cfif>

</cffunction>

Now... when the user goes to login to the app in Firefox... nothing happens. The page seems to load but the loading bar disappears and you stay on the same page. I've isolated it to this issue b/c if I comment out the <cfif> in the above Firefox loads fine (but any Flex app doesn't know who the user is).

Please help. Thx

    This topic has been closed for replies.

    1 reply

    BKBK
    Community Expert
    Community Expert
    March 23, 2010

    Where do you assign value to the variable session.toporg? I suspect there are times when the value isn't set.

    March 23, 2010

    it happens after an LDAP authentication when the user logs into the app. this happens everytime.

    firefox doesn't have any issues with CF sessions... it seems only cookies in this instance.

    April 7, 2010

    i figured this out. it was the size and length of the data i was trying to store in the cookie.

    something like this: cookie.allowed_ids = "'1234','2345','1125','6685','5521',1122'',........." and this could potentially store over a hundred ids.

    it seems firefox doesn't like this cookie and by not using it everything else works.