Invalid Authenticity Token during login form submission

1.1k Views Asked by At

I understand about the error:

ActionController::InvalidAuthenticityToken

After a year or so, I am back to my old rails project which is using Rails 2.3.8. Everything was fine. Server started but when I submit the login form, the error appeared. The same project was working a year ago. Don't know what gone wrong.

Someone suggested in other posts to comment out the line protect_from_forgery in application_controller.rb but that doesn't seem to be a good idea as it may remove the error but will be prune to forgery attacks.

At first glance it seems to be some session issue which is old enough and is not cleared.

To cope up with sessions, I run the following command -

rake db:sessions:clear

I started the server and again the same problem.

After seeing the lot of posts, still don't know how to resolve. Any ideas ?

0

There are 0 best solutions below