Skip to main content
jacobb39120489
Participant
September 3, 2015
Answered

different session contents for the same session, CF9

  • September 3, 2015
  • 2 replies
  • 503 views

Two URLs:

http://DOMAIN/zshowsession.cfm

http://DOMAIN/institutes/office/zshowsession.cfm

The DOMAIN portion is identical.  Same site.  Same CF server.

Both files contain this code:

<cfdump var="#session#">

One outputs this:

The other outputs this:

You can see it's the same cfid and cftoken, but the contents of session are different.  This is causing me problems.

Is anyone aware of any legitimate reason why this would be happening?  Maybe some weird CF configuration in the CFIDE or something?  I already checked the two relevant Application.cfc files (one in /, one in /institutes) and there is nothing that modifies the session.

    This topic has been closed for replies.
    Correct answer jacobb39120489

    I fixed it.  The problem was that the two Application.cfc files had different values for This.name.  When I made them equal the session data became synchronized.

    2 replies

    Dave Ferguson
    Participating Frequently
    September 4, 2015

    Look for an application.cfm/cfc in the directory path beyond the one in the app root.  Also, look in the app.cfc file and see if there is anything in there that could be adding the session var.

    jacobb39120489
    Participant
    September 4, 2015

    I have looked through the entire directory structure up to the root of the drive itself.  There are exactly two Application.* files in play:

    /Application.cfc

    /institutes/Application.cfc

    There are no Application.cfm files, only cfc.

    Both of these Application.cfc files contain this constructor (inside of the component, but outside of any function).  The only difference is This.name:

      <cfset This.name = "Institutes">

      <cfset This.Sessionmanagement = true>

      <cfset This.Sessiontimeout = createtimespan(0,0,240,0)>

      <cfsetting requesttimeout="240">

      <cfset This.name = "SumReg">

      <cfset This.Sessionmanagement = true>

      <cfset This.Sessiontimeout = createtimespan(0,0,240,0)>

      <cfsetting requesttimeout="240">

    Then they both have onApplicationStart defined which purely sets application variables and nothing else.

    That's it.  Nothing that modifies the session.

    It's worth noting that the nature of the problem is that if I change something in the session then it only reflects in one location.  If what you suspect was true (that something is changing the session) then I would expect to see any such changes reflected in both locations.  For example, in my OP you can see from the two images that only one session has 'foobar' defined.  I set that in one location to test session consistency and it demonstrated that they are not consistent.

    jacobb39120489
    jacobb39120489AuthorCorrect answer
    Participant
    September 4, 2015

    I fixed it.  The problem was that the two Application.cfc files had different values for This.name.  When I made them equal the session data became synchronized.

    WolfShade
    Legend
    September 4, 2015

    If the application.cfc isn't changing anything in the session, is zshowsession.cfm changing anything?

    ^_^

    jacobb39120489
    Participant
    September 4, 2015

    Nope.  The entire content of both zshowsession.cfm files is this:

    <cfdump var="#session#">