# protect\_from\_forgery with db-session (Rails 2.3.2)

**URL:** <https://discuss.rubyonrails.org/t/protect-from-forgery-with-db-session-rails-2-3-2/43665>\
**Category:** rubyonrails-talk\
**Created:** [June 22, 2009, 1:53pm UTC](https://discuss.rubyonrails.org/t/protect-from-forgery-with-db-session-rails-2-3-2/43665 "2009-06-22T13:53:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [June 22, 2009, 1:53pm UTC](https://discuss.rubyonrails.org/t/protect-from-forgery-with-db-session-rails-2-3-2/43665/1 "2009-06-22T13:53:10Z")

</div>

I try to use db-session with protect\_from\_forgery.

But I always get a error msg:

ActionController::InvalidAuthenticityToken.

application\_controller.rb protect\_from\_forgery #:secret =\> 'top\_secret'

session\_store.rb ActionController::Base.session\_store = :active\_record\_store

hope you can help me.

Best regards

---

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [June 22, 2009, 2:05pm UTC](https://discuss.rubyonrails.org/t/protect-from-forgery-with-db-session-rails-2-3-2/43665/2 "2009-06-22T14:05:47Z")

</div>

After searching around it looks for me, like the authenticity\_token of the forum is not saved correctly by the session.

An therefore rails thinks the authenticity\_token is invalid.
