在控制器我有2个动作Ruby on Rails的会话=零
def action1
session[:test]="test"
render :text => session[:test] # output test
end
def action2
render :text => session[:test] # output nil
end
我执行第一动作1所以该会话被设置 然后我执行动作2但会话[:试验]为nil
所以我究竟做错了什么?
在控制器我有2个动作Ruby on Rails的会话=零
def action1
session[:test]="test"
render :text => session[:test] # output test
end
def action2
render :text => session[:test] # output nil
end
我执行第一动作1所以该会话被设置 然后我执行动作2但会话[:试验]为nil
所以我究竟做错了什么?
您使用的是什么类型的会话存储? 'ActionController :: Base.session_store' – 2009-10-29 23:32:27
我正在使用active_record_store – Mathieu 2009-10-30 00:01:48
你为什么使用active_record_store?有没有原因。用cookie_store免费得到这么多。 – 2009-10-30 04:45:01