Forum: Ruby on Rails session store active_record_store doesn't work.

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
D9854c18c487c1669330ca77158ff8b5?d=identicon&s=25 Goro Kuroita (k560)
on 2008-12-31 09:28
(Received via mailing list)
I want to use acitive record store session.
So I edited files like below.

*environment.rb
config.action_controller.session_store = :active_record_store

*application.rb
protect_from_forgery :secret => '54420ada.........'

*rake task
rake db:sessions:create #successfully created

And controller and views like below

*Controller
class TestIndexController < ApplicationController
  def index
    session[:test]='Test Value'
    ......
  end
end

*Views
test_index/index.html.erb
<%=session[:test]%> #=>'Test Value'

test_index/new.html.erb
<%=session[:test]%> #=>nil<==This is the problem!!

Session table creates session data certainly, but I can't get
session[:test]
value except index action.
Why?? Please give me advice!

PS:My environment is below.
Rails 2.2.2
ruby1.8.6
gem 1.3.1
Mac OS 10.5.5

--
View this message in context:
http://www.nabble.com/session-store-active_record_...
Sent from the RubyOnRails Users mailing list archive at Nabble.com.
This topic is locked and can not be replied to.