views:

511

answers:

2

Hi,

In a controller I have 2 actions

def action1
  session[:test]="test"
  render :text => session[:test]  # output test
end

def action2
  render :text => session[:test]  # output nil
end

I perform first action1 so the session is set Then I perform action2 but session[:test] is nil

So what am I doing wrong?

+1  A: 

Cookies enabled? Assuming you are using the default cookie-based session_store, make sure you have cookies enabled while testing.

Schema in place? An activerecord session_store requires a sessions table with the correct columns (id, session_id, data) More info.

Ryan McGeary
The schema is in place, actually it seems that the session is set only the first I initialize it.When I make a modification the session value do not update.is there anything else to do than :session[:test]="test"session[:test]="test2"
Mathieu
A: 

I have the same issue. The session object seems to be nil when entering the application controller.

Mathew O'Hare