I got rid of the @ signs and went from strings to symbols,
but things are still broken:
At the end of the login method (user_controller.rb), I’m
setting values into session, then redirecting, as:
puts ">>>>> redirecting" # TRACE
session[:user] = u.id
session[:foozle] = 'bar' #{T}
if (session[:foozle])
puts ">>>>> login: foozle = '#{session[:foozle]}'"
else
puts ">>>>> login: foozle is undefined"
end
redirect_to :controller => 'main',
:action => 'welcome'
This prints out
redirecting
login: foozle = ‘bar’
Then, in get_user (application.rb), I try to retrieve them:
if (session)
puts ">>>>> session is defined in get_user"
puts ">>>>> class = #{session.class}"
if (session[:foozle])
puts ">>>>> get_user: foozle = '#{session[:foozle]}'"
else
puts ">>>>> get_user: foozle is undefined"
end
else
puts ">>>>> session is undefined in get_user"
end
This prints out
session is defined in get_user
class = CGI::Session
get_user: foozle is undefined
session[:user] is undefined
Oh yeah:
% rails --version
Rails 1.1.6
-r
http://www.cfcl.com/rdm Rich M.
http://www.cfcl.com/rdm/resume [email protected]
http://www.cfcl.com/rdm/weblog +1 650-873-7841
Technical editing and writing, programming, and web development