I am using active record sessions and everything works fine. I am
integrating it with phpbb however so i need some extra fields populated
in
the session table. In application.rb i put a before_filter to update
the
session table
I have a model for the sessions
$ more app/models/session.rb
class Session < ActiveRecord::Base
set_primary_key “session_id”
set_table_name “phpbb_sessions”
end
and a before_filter:
session_hash = { “session_user_id” => @entry.user_id, “session_ip” =>
encode_ip, “session_time” => Time.now , “session_logged_in” => 1}
@tmpsess = Session.find_by_session_id(session.session_id)
@tmpsess.update_attributes(session_hash) if @tmpsess
the logfile then shows :
UPDATE phpbb_sessions SET
“data” =
‘BAh7EjoOZGVmX3N0YXRlIgdOWToIbGF0Zho0MC42NTk5OTk5OTk5OTk5OTcArhQ6DGRlZl9sYXQwOglsb25nZhstNzMuOTgwMDAwMDAwMDAwMDA0AIUfOgh1’,
“session_start” = 0, “session_user_id” = 3, “session_admin” = 0,
“session_time” = 1148349972, “session_logged_in” = 1, “id” = 22,
“session_page” = 0, “session_ip” = ‘185afae3’, “updated_at” =
‘2006-05-22
22:06:12’ WHERE session_id = ‘a1f7912ebd968e7136e10d6d67021680’
However the extra fields dont get updated. running this manually in
postgres works as expected. is there some sort of limitation on the
session
table that would cause this behavior ?
thanks for any input
adam