ActiveRecordStore InvalidAuthenticityToken
- by Andy
I have recently been using cookie store and I want to transition to active record store. However I keep getting an invalid authenticity token. After deleting my cookies, I was able to access the page just fine, but I don't want all my users to come to my page, get a huge error and then figure out that I want them to delete their cookies.
So I made a function called delete cookies:
after_filter :delete_cookie
def delete_cookie
puts "deleting cookies"
cookies.to_hash.each_pair do |k, v|
puts k
cookies.delete(k)
end
end
In application controller, but it doesn't seem to be working correctly. I still see my cookie after visiting any page. I feel like there really should be a better solution but I can't seem to find any so far. Any hints?