I have been making some experiments allowing or disallowing cookies.
If you have cookies disabled in your browser and try to login to this forum, you get the message that login succeeded and there is this usual redirect but then you can read on top of the page that you are not logged in.
It would be nice if there was a message telling us that we disabled cookies and that we should not have done this.
This problem with the forum raises a Rails-question:
How can I manage this problem in my Rails project?
I think I should write some exception-handling into the file
app/controllers/login_controller.rb but I get the following exception as soon as I try to login to my project just before anything in my method index has been executed:
ActionController::InvalidAuthenticityToken in LoginController#index
In the login_controller.rb I have the code:
def index
puts " ------------------ test 0"
end
And in the view there is are two text_fields for login and password and a submit-button. If I press the button without filling in the text_fields there is no error and if I fill in a valid login/password I get the error mentioned above caused by not allowing cookies.
I would like do redirect the user to a page telling her to allow cookies.
My question: Where do I have to put the code for exception handling in this case if the error appears before anything in the index-method is executed?
Last edited by pandora (2008-09-14 10:08:36)