Solved

Cold Fusion Session Swapping

Posted on 2002-07-01
4
472 Views
Last Modified: 2013-12-24

I'm runnning into an interesting problem with CF session variables getting swapped by (I think) the server. If two users come in from the same IP (behind a firewall or NAT or whatever) within a minute of each other, they occasionally get the other person's session ID. Macromedia has a page on their site that gives a solution to this problem -- their solution being check and make sure the IP's are different.

Obviously, this doesn't work in this case, since we know the IP's are supposed to be the same.

Has anyone had any similar problems and found a way around them? Or can you point me to a site with more information on this topic than the Macromedia site? Thanks! :-)

Jaxman
0
Comment
Question by:jaxman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 5

Expert Comment

by:Yog
ID: 7122773
are you using CFLOCK when setting and reading session variables, http://www.sys-con.com/coldfusion/article.cfm?id=135
0
 

Author Comment

by:jaxman
ID: 7123242
I'm going through and doing a thorough check on all the code, but I believe everything is locked down appropriately.

We've got a situation where we're using session.datasource to hold our DSN, and then at the top of application.cfm we're assigning it to request.appDSN so we can work with it in the request scope ever after instead of the session scope (to make locking easier to deal with).

Question: Will reading from a session variable (ie: putting session.datasource as an r-value of an operation) potentially cause corruption if not properly locked, or is it only when the session variables are l-values?


Jax
0
 
LVL 5

Accepted Solution

by:
Yog earned 200 total points
ID: 7123284
Jax,

yeah locking may require if you are not making a copy of it and using even for a Request scope. If you turn on (from CF Administrator) stricter checking it will tell you wheather the code is not behaving well or behaving well.

if you are using the Request scope, make sure you use the duplicate if you are making another copy of it and using, an "=" usage may just make a reference and wont help

eg.

<CFLOCK SCOPE="Application" TIMEOUT="10">
<CFSCRIPT>
  Request.Application = StructNew();
  Request.Application = Duplicate(Application);
</CFSCRIPT>
</CFLOCK>

<CFLOCK SCOPE="Session" TIMEOUT="10">
<CFSCRIPT>
  Request.Session = StructNew();
  Request.Session = Duplicate(Session);
</CFSCRIPT>
</CFLOCK>

This was suggested to me by pikala and it works good.

Yog
0
 

Author Comment

by:jaxman
ID: 7123302
I'll have to give that a try...you've given me some good pointers, its going to take a while to test them out (these non-deterministic problems are crazy to track down). Thanks for the info! :-)

Jax
0

Featured Post

Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question