Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ColdFusion Session issue - multiple users behind one proxy IP -- cftoken and cfid seems to be shared

I have an application that uses coldfusion's session management (instead of the J2EE) session management.

We have one client, who has recently switched their company's traffic to us to come viaa proxy server in their network.

So, to our Coldfusion server, it appears that all traffic is coming from this one IP Address, for all of the accounts of this one company..

Of the session variables, Part 1 is kept in a cflock, and Part 2 is kept in editable session variables. I may be misundestanding, but we have done it this way as we modify some values as needed throughout the application's usage.

We are now running into an issue of this client having their session variables mixed up (?). We have one case where we set a timestamp.. and when it comes time to look it up, it's empty. From the looks of it this is happening because of another user on the same token.

My initial thoughts are to look into modifying our existing session management to somehow generate a unique cftoken/cfid, or to start using jsession_ID, if this solves the problem at all.

I have done some basic research on this issue and couldn't find anything similar, so I thought I'd ask here.

Thanks!

like image 754
Smooth Operator Avatar asked Apr 15 '10 17:04

Smooth Operator


People also ask

How do I use ColdFusion session variables without using cookies?

To use ColdFusion session variables without using cookies, each page must pass the CFID and CFToken values to any page that it calls as part of the request URL. If a page contains any HTML href a= links, cflocation tags, form tags, or cfform tags the tags must pass the CFID and CFToken values in the tag URL.

What is JSESSIONID in ColdFusion?

A unique identifier for the session.ColdFusion session management: a combination of the application name and CFID and CFToken values.J2EE session management: the jsessionid value. Note: ColdFusion lets you delete or change the values of the built-in session variables. As a general rule, avoid doing so.

How do I use ColdFusion client variables and J2EE session variables?

To use ColdFusion client variables and J2EE session variables, pass the CFID, CFToken, and jsessionid values in URLs. The behavior is as follows when CFID and CFTOKEN are provided in the URL: If session exists, the CFID and CFTOKEN from the URL are ignored.

What happens when CfID and cftoken are provided in the URL?

The behavior is as follows when CFID and CFTOKEN are provided in the URL: If session exists, the CFID and CFTOKEN from the URL are ignored. If the session does not exist, CFID and CFTOKEN from the URL are used to validate the session and the session is used if it is valid. If the session is not valid, a new session is created.


1 Answers

I've run into similar problems on and off for years.

JSession cookies seem to help (no hard data on that) but one solution that I've implemented repoeatedly is using no-cache and cache expiry headers on every page.

http://www.bpurcell.org/blog/index.cfm?entry=1075&mode=entry gives some specifics on how to implement this.

In extreme cases, we've been forced to pass the token and cfid in the links/forms, but that is a PITA to implement, so I'd try the cache expiry/prevention soluiton first.

like image 119
Ben Doom Avatar answered Oct 01 '22 13:10

Ben Doom