# Rails session problem

**URL:** <https://www.ruby-forum.com/t/rails-session-problem/111487>\
**Category:** Ruby\
**Created:** [August 7, 2007, 9:42pm UTC](https://www.ruby-forum.com/t/rails-session-problem/111487 "2007-08-07T21:42:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ronald\_braswell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f9ae1b/32.png) [@ronald\_braswell](https://www.ruby-forum.com/u/ronald_braswell)\
**Post date:** [August 7, 2007, 9:42pm UTC](https://www.ruby-forum.com/t/rails-session-problem/111487/1 "2007-08-07T21:42:55Z")

</div>

I have two different browser sessions (on two different machines)  
running  
against a Rails (1.2.3) application  
which is being deployed with Apache 2.2.4 balacing requests across two  
Mongrels (1.0.1, cluster 1.0.2). I am using the default  
PStore mechanism for storing session information.

The problem is that the two sessions seem to be modifiying each other’s  
data  
occasionally.  
Looking in tmp/sessions reveals that both sessions have the same value  
for a  
session key that should be different.  
The session data for the key is populated from AJAX calls that result  
from  
dragging and dropping an item from one sortable element  
to another. Here is the code for the action that does this:

def update\_test\_run  
session[:sys\_test\_ids] = params[:selected\_tests] if  
params[:selected\_tests]  
render :nothing =\> true  
end

The production.log indicates that the correct test ids are being passed  
in  
params[:selected\_tests] to update\_test\_run  
but later when the action for the form is executed, the wrong test id is  
found in session[:selected\_tests].

Does anyone know what might be the cause of this? It does not happen  
very  
often, maybe once in 20 times but it should  
not happen at all.

Ron
