[RAILS] ActionController :: InvalidAuthenticityToken error resolution

While learning Rails, when I tried to log in from logout, I got an error like the title.

What I did to solve it

First, change the logout action of users_controller.rb as follows.
def logout
  session[:user_id] = nil
  flash[:notice] = "logged out" 
 redirect_to("/login") 
end

Changes

It was fixed by adding flash and changing the redirect destination to/login.

Recommended Posts

ActionController :: InvalidAuthenticityToken error resolution
ITMS-90626 Error Resolution
rails error resolution summary
Error resolution on Heroku
Spring Boot + PostgreSQL error resolution method
Commit failed exit code 1 error resolution
Multiple migrations have the name Error resolution
RSpec error resolution undefined method `feature'for RSpec: Module
RSpec error resolution undefined method'name' in'user' factory
[Rails / Heroku] Error resolution procedure after push