Ajax, MemoryStore and sessions

Have you ever worked with Ajax, memoryStore and sessions in Rails?

I’m trying to pass a value through a session variable to various
I’m calling the methods with Ajax on a submit button. I do this twice on
page. The first time I pass a variable from the page to the controller
store it in the session and write a log entry. This works fine. When the
second button gets pressed it tries to retrieve the session value
stored there. However the session doesn’t contains anything. The
value is gone. I’m not sure what is happening and how to get around this
problem. Can anyone explain what I’m doing wrong?

I need to use memeoryStore since the object I want to store cannot be
marshalled to PStore.

Thxs, Rob

Here is the page code:
<%= form_remote_tag(:update => “mydiv”,
:url => {:action => :ajaxp2}) %>
Enter a number:
<%= text_field_tag(:arg1, @params[:arg1], :size => 5, :maxlength => 5)
<%= submit_tag(“Submit number with Ajax”) %>
<%= end_form_tag %>

<%= form_remote_tag(:update => "monitor", :url => {:action => :domonitor}) %> Start the monitor process: <%= submit_tag("Start monitor with Ajax") %> <%= end_form_tag %>

Here is the controller code:
def ajaxp2
session[:value1] = params[:arg1]
logger.warn(“p1=” + params[:arg1])
render(:layout => false)

def domonitor
soap = session[:value1]
render(:layout => false)


View this message in context:
Sent from the RubyOnRails Users forum at Nabble.com.