InvalidAuthenticityToken error with db sessions

I added login to my app and storing the sessions in the db. I un-commented the "config.action_controller.session_store = :active_record_store" line in the environment.rb file, and the :secret in the application.rb file.

Now, when I try to login I get the error InvalidAuthenticityToken. Here's my login form:

<% form_for :user, :url => { :action => 'do_login' } do |f| %>   <p>user: <%= f.text_field :user_name %></p>   <p>pass: <%= f.password_field :password %></p>   <%= f.submit 'login' %> <% end %>

I checked the markup and the hidden field with the token appears. I'm baffled on what keep causing this error - and would appreciate any help.

sa 125 wrote:

I added login to my app and storing the sessions in the db. I un-commented the "config.action_controller.session_store = :active_record_store" line in the environment.rb file, and the :secret in the application.rb file.

Now, when I try to login I get the error InvalidAuthenticityToken. Here's my login form:

<% form_for :user, :url => { :action => 'do_login' } do |f| %>   <p>user: <%= f.text_field :user_name %></p>   <p>pass: <%= f.password_field :password %></p>   <%= f.submit 'login' %> <% end %>

I checked the markup and the hidden field with the token appears. I'm baffled on what keep causing this error - and would appreciate any help.

I should also mention that the exact error is:

ActionController::InvalidAuthenticityTokem in LoginController#do_login

i answered to this in your other thread...