Re: :active_record_store + :table_name_with_underscore session issues

Tim
Thu, 29 Jan 2009 00:26:18 -0000

You may want to browse:

http://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection/ClassMethods.html

and

http://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection.html

Good luck!
Tim

On Jan 28, 1:24 pm, Greg Donald
<gdon...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:
> Today I created a new Rails 2.2.2 project.
>
> I''m using Oracle and activerecord-oracle-adapter (1.0.0.9250).
>
> I''m using ActiveRecord::Base.primary_key_prefix_type >
:table_name_with_underscore, which is a spec for the project that I
> cannot change.
>
> I ran `rake db:sessions:create` and it created a new migration that
> looks like this:
>
> class CreateSessions < ActiveRecord::Migration
>
>   def self.up
>     create_table :sessions do |t|
>       t.string :session_id, :null => false
>       t.text :data
>       t.timestamps
>     end
>     add_index :sessions, :session_id
>     add_index :sessions, :updated_at
>   end
>
>   def self.down
>     drop_table :sessions
>   end
>
> end
>
> This does not work.  I get the error:
> ActionController::InvalidAuthenticityToken on any forms that are
> posted.
>
> When I look in the sessions table the hashed data in the `data` field
> looks normal, but there are integers being stored in the session_id
> field, not the 32 character hashes I would expect.  And every page
> reload creates a new session, the integer stored in the session_id
> field is incremented by one.  I''m thinking session data is being
> written, but then cannot be retrieved.
>
> I''ve tried a number of things I found searching, such as:
>
> CGI::Session::ActiveRecordStore::Session.set_primary_key
''session_id''
>
> none of which help.  Any idea what I need to do?
>
> I have other, older Rails apps using active_record_store sessions that
> work just fine, but this is my first one on Rails 2.2.2 and so far
> it''s a no-go.
>
> --
> Greg Donaldhttp://destiney.com/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com