Getting ActionController::InvalidAuthenticityToken error Please help tried to run thru the solutions searched via google but no luck

Hi ,

I am trying to test spot.us on my local machine , I installed it and have rails 2.3.2 but when i register a new user i get the following error ActionController::InvalidAuthenticityToken.

I am pasting the traces please help , I am pretty new to ror so may sound awkward sometimes

C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/ action_controller/request_forgery_protection.rb:79:in `verify_authenticity_token' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/ active_support/callbacks.rb:178:in `send' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/ active_support/callbacks.rb:178:in `evaluate_method' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/ active_support/callbacks.rb:166:in `call' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/ action_controller/filters.rb:225:in `call' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/ action_controller/filters.rb:629:in `run_before_filters' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/ action_controller/filters.rb:615:in `call_filters' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/ action_controller/filters.rb:610:in `perform_action_without_benchmark' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/ action_controller/benchmarking.rb:68:in `perform_action_without_rescue' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/ active_support/core_ext/benchmark.rb:17:in `ms' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/ active_support/core_ext/benchmark.rb:10:in `realtime' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/ active_support/core_ext/benchmark.rb:17:in `ms' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/ action_controller/benchmarking.rb:68:in `perform_action_without_rescue' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/ action_controller/rescue.rb:160:in `perform_action_without_flash' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/ action_controller/flash.rb:141:in `perform_action' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/ action_controller/base.rb:523:in `send' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/ action_controller/base.rb:523:in `process_without_filters' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/ action_controller/filters.rb:606:in `sass_old_process' C:/InstantRails/rails_apps/spot-us2/vendor/gems/haml-2.0.7/lib/sass/ plugin/rails.rb:19:in `process' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/ action_controller/base.rb:391:in `process' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/ action_controller/base.rb:386:in `call' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/ action_controller/routing/route_set.rb:433:in `call' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/ action_controller/dispatcher.rb:88:in `dispatch' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/ action_controller/dispatcher.rb:111:in `_call' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/ action_controller/dispatcher.rb:82:in `initialize' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/ active_record/query_cache.rb:29:in `call' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/ active_record/query_cache.rb:29:in `call' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/ active_record/connection_adapters/abstract/query_cache.rb:34:in `cache' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/ active_record/query_cache.rb:9:in `cache' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/ active_record/query_cache.rb:28:in `call' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/ active_record/connection_adapters/abstract/connection_pool.rb:361:in `call' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/ head.rb:9:in `call' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/ methodoverride.rb:24:in `call' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/ action_controller/params_parser.rb:15:in `call' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/ action_controller/rewindable_input.rb:25:in `call' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/ action_controller/session/cookie_store.rb:93:in `call' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/ action_controller/reloader.rb:9:in `call' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/ action_controller/failsafe.rb:11:in `call' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/ lock.rb:11:in `call' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/ lock.rb:11:in `synchronize' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/ lock.rb:11:in `call' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/ action_controller/dispatcher.rb:106:in `call' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/rack/ static.rb:31:in `call' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/ urlmap.rb:46:in `call' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/ urlmap.rb:40:in `each' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/ urlmap.rb:40:in `call' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/rack/ log_tailer.rb:17:in `call' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/ content_length.rb:13:in `call' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/ chunked.rb:15:in `call' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/ handler/mongrel.rb:61:in `process' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86- mswin32-60/lib/mongrel.rb:159:in `process_client' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86- mswin32-60/lib/mongrel.rb:158:in `each' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86- mswin32-60/lib/mongrel.rb:158:in `process_client' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86- mswin32-60/lib/mongrel.rb:285:in `run' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86- mswin32-60/lib/mongrel.rb:285:in `initialize' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86- mswin32-60/lib/mongrel.rb:285:in `new' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86- mswin32-60/lib/mongrel.rb:285:in `run' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86- mswin32-60/lib/mongrel.rb:268:in `initialize' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86- mswin32-60/lib/mongrel.rb:268:in `new' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86- mswin32-60/lib/mongrel.rb:268:in `run' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/ handler/mongrel.rb:34:in `run' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/commands/ server.rb:111 C:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: 31:in `gem_original_require' C:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: 31:in `require' script/server:3

Request

Parameters:

{"user"=>{"password_confirmation"=>"s", "type"=>"Citizen", "terms_of_service"=>"1", "first_name"=>"saurabh1", "last_name"=>"s", "password"=>"s", "email"=>"sagarwal1981@gmail.com"}, "x"=>"56", "y"=>"15", "authenticity_token"=>"LwLcbcAm56CqsVprhVAcL6AOrBJMsRcD+Hp6Q9WiVaA="}

Thanks Saurabh

It's possible that you have a session key left over from a previous app. Try clearing your session cookies and see if that helps.

Cheers, Nicholas

Getting the same error when creating new user...

ActionController::InvalidAuthenticityToken in UsersController#create

ActionController::InvalidAuthenticityToken RAILS_ROOT: /home/admin/spot-us

Application Trace | Framework Trace | Full Trace /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/request_forgery_protection.rb:79:in `verify_authenticity_token' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/callbacks.rb:178:in `send' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/callbacks.rb:178:in `evaluate_method' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/callbacks.rb:166:in `call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/filters.rb:225:in `call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/filters.rb:629:in `run_before_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/filters.rb:615:in `call_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/benchmark.rb:17:in `ms' /usr/lib/ruby/1.8/benchmark.rb:308:in `realtime' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/benchmark.rb:17:in `ms' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/rescue.rb:160:in `perform_action_without_flash' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/flash.rb:141:in `perform_action' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/base.rb:523:in `send' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/base.rb:523:in `process_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/filters.rb:606:in `sass_old_process' /home/admin/spot-us/vendor/gems/haml-2.0.7/lib/sass/plugin/rails.rb:19:in `process' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/base.rb:391:in `process' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/base.rb:386:in `call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/routing/route_set.rb:433:in `call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:88:in `dispatch' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:111:in `_call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:82:in `initialize' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/query_cache.rb:29:in `call' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/query_cache.rb:29:in `call' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/query_cache.rb:9:in `cache' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/query_cache.rb:28:in `call' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/head.rb:9:in `call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/methodoverride.rb:24:in `call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/params_parser.rb:15:in `call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/rewindable_input.rb:25:in `call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/session/cookie_store.rb:93:in `call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/reloader.rb:9:in `call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/failsafe.rb:11:in `call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in `call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in `synchronize' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in `call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:106:in `call' /usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/rack/static.rb:31:in `call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/urlmap.rb:46:in `call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/urlmap.rb:40:in `each' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/urlmap.rb:40:in `call' /usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/rack/log_tailer.rb:17:in `call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/content_length.rb:13:in `call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/chunked.rb:15:in `call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/handler/mongrel.rb:61:in `process' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:159:in `process_client' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:158:in `each' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:158:in `process_client' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `initialize' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `new' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in `initialize' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in `new' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in `run' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/handler/mongrel.rb:34:in `run' /usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/commands/server.rb:111 /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' script/server:3 Request

Parameters:

{"x"=>"29", "y"=>"21", "authenticity_token"=>"vgJbe0UJTbEEYCC3oZl6YlOArxE2Uc56o98qqgZOxYs=", "user"=>{"password_confirmation"=>"pass", "type"=>"Citizen", "last_name"=>"yat", "terms_of_service"=>"1", "password"=>"pass", "first_name"=>"lav", "email"=>"ASDFG@HJKL.com"}} Show session dump

Response

Headers:

{"Content-Type"=>"", "Cache-Control"=>"no-cache"}