Skip to main content
September 4, 2006
Question

CFMX7 and session cookies- broken/different?

  • September 4, 2006
  • 2 replies
  • 581 views
Howdy,

We've migrated a site from CFMX 6 to CFMX7(Linux in both cases), and we are finding users seem to be having a hard time holding on to their sessions. Our client is getting a lot of complaints that users have to adjust their cookie acceptance policies, and that they buy from other sites off the web and don't have a problem. So our client is coming back to us for answers, and so far we don't have any. The issue seems primarily, but not exclusively, confined to IE. Compounding the issue is that we do not seem able to reproduce the problem, but by logging the CFID and CFTOKEN cookies on incoming requests, we can see that a lot of people out there are having issues (the CFID and CFTOKEN cookies are not returned in their requests, and when we trap their SESSION.CFID AND SESSION.CFTOKEN values, it changes on every page hit). Right now, we see about 100-150 incidents a day.

At this point it seems clear there is a difference, although precisely what that difference might be is unclear. We've picked up all the hot fixes and we are running 7.0.2 now, but it seems to make no difference. We can try to provide support and workarounds for users to adjust their cookie acceptance policiies, but not everyone can follow instructions, and why should they have to- if they've bought from a site before, why can't they buy now?

In our application.cfm, client management is set to No, and sessionmanagement, setclientcookies, and setdomaincookies are all set to yes; this worked fine before, and also matches another 6.1 Linux site that seems to be burbling along perfectly fine.
All of these sites are e-commerce, so we do not have direct contact with the customers, just our (increasingly annoyed) client.

If we can't get this solved, we may have to investigate other alternatives to CF- our clients don't want to have to deal with angry customers, or pay to have their sitre completely rewritten when moving to a new CF release.

Any ideas? We're logging what data we can from the CGI request, and tracking the cookies sent back to us through GetHttpRequest.

Than you for your time and attention
    This topic has been closed for replies.

    2 replies

    Participating Frequently
    September 4, 2006
    Is this a co-location machine? Are other sites on it? I'm thinking if there is X amount of RAM on the server and Y number of applications that the sessions are getting destroyed.

    Can you monitor the memory usage? Are you able to recreate the problem? Does the problem appear to occur during peak times? Is there sufficient memory on the server?

    Also if the CF service is restarted all sessions are destoryed. If this website is hosted with other CF sites on a shared server I wouldn't be suprised that some other site's code hangs the server which requires a restart.

    Lastly, how do you handle timeouts? Do you use meta tags to redirect after X amount of minutes, JavaScript or just let the page fail on request after a timeout?
    September 5, 2006
    Howdy,

    It is a dedicated server- this is the only site on it.

    The frequency of the problem appears to be related to the number of sessions- when traffic is high, it happens a lot, and when it is low it happens less often, but it still happens. That is, the percentage of sessions at any one time that appear to have this issue seems to be relatively constant.

    I've monitored memory usage using top- the server is not swapping, and there still seems to be RAM available (about 20% free). I'm not seeing any error messages or restarts in the CF logs- I don't know about JRun or anything Java-related, since I admit I know very little about that- even where any log files for Java or Jrun might be.

    Session timeouts are handled differently depending on where you are on the site- most of the site we do nothing, but if you are in the middle of checking out we catch this and direct to an error/restart checkout page.

    Judging from the Apache logs and repeated attempts to get a cart (based on their CFTOKEN), I doubt it is a timeout issue, since they should be able to get a cart and hang onto it the second time round. If I chek the logs, interwoven with these problem sessions I see other accesses from other IP ddresses where folks seem to have no problem buying things from the site. So it's not like suddenly no one can buy anything.

    Unfortunately we have not been able to reproduce the issue. The only way I seem to get my browser to act the same way is to reject cookies, or set to prompt and then reject them. But that doesn't jive with the email from users passed on to us from our client- the emails all claim they've ordered off the web before, and that they have not adjusted their browser policies. On our systems if we set IE to the default cookie acceptance policy, everything is fine. I've also tried from home, and several of our other developers have tried also, with no one observing this behavior.

    We have a site set up similarly running on 6.1 with no problem; we have a shared (Windows) server running MX 7 with none of our clients on that box reporting problems (though the volume on that box is fairly low compared to this one).

    We've also observed that some of the users who apprarently run into this the first time they try to buy something (and get diverted to a page asking them to check their cookies) , are subsequently able to buy something and check out successfully (same IP address, and access within a minute or so of the first attempt). Others are not successful- we'll see several attempts within a minute all getting diverted to the cookie page, all from the same IP address, but with a steadily incrementing CFID (the first one might have a CFID of, say, 20000, the next 20001, the next, 20003, then 20004, etc.).
    Plus, of course, emails passed on to us by the client from folks who claim to have bought items before and don't understand how to, or do not want to, relax their cookie acceptance policies.

    Is there someway to monitor JRun that might tell us something?
    Participating Frequently
    September 5, 2006
    Given you have fully updated CF and tried extensive testing I would escalate it to Adobe Tech Support and see if they have any insight. I personally haven't seen the issue you describe. Hopefully another forum poster can help or Adobe can aid you to get this problem solved.
    Participating Frequently
    September 4, 2006
    Your sessions may be corrupted. Are you using <cflock> when you set and read session variables? Also, you may want to try enabling the attributes "Use UUID for cftoken" and " Use J2EE session variables" in CF admin. These attributes relate to your issue.

    Use UUID for cftoken

    Select this option to configure the cftoken cookie to use a Universally Unique Identification number (UUID), rather than a random number, as a token identifier. A UUID guarantees a unique identifier for the token.

    Use J2EE session variables

    Specifies whether to use ColdFusion session variables or J2EE session variables. When you enable J2EE session variables, ColdFusion MX creates an identifier for each session and does not use the CFToken or CFID cookie value. For more information, see ColdFusion MX Developer's Guide.
    September 4, 2006
    Howdy,

    Thanks for responding.

    The site uses the CFTOKEN as part of the shopping cart data. Switching to UUID would require a signifcant rewrite because the field length is much larger.

    Yes we are locking.

    Switching to J2EE sessions just means a different cookie, correct? Are the CFID and CFTOKEN variables still passed as cookies in this instance? If not, then we're still looking at a code rewrite for the shopping cart pieces of the site. That's something I'd rather not undertake unless I understand better why the problem is happening now, on MX7, when it does not seem to have been happening before, and therefore have greater assurance that making the changes will fix the problem.

    Thanks again for taking the time to respond.