ActiveRecordStore InvalidAuthenticityToken

Posted by Andy on Stack Overflow See other posts from Stack Overflow or by Andy
Published on 2010-05-31T06:05:48Z Indexed on 2010/05/31 6:12 UTC
Read the original article Hit count: 232

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?

© Stack Overflow or respective owner

Related posts about ruby

Related posts about session