Rails ( set_no_cache method) Cannot disable browser caching in Safari and Opera

后端 未结 3 472
后悔当初
后悔当初 2021-01-02 03:28

After using Devise for my authentication, I found that there was a security hole in that, after the user logs out, the session variables are preserved. This allows anyone to

3条回答
  •  伪装坚强ぢ
    2021-01-02 04:06

    I found that doing this in my application controller worked great for development.

    after_filter  :expire_for_development
    
    protected
    
    def expire_for_development
      expires_now if Rails.env.development?
    end
    

提交回复
热议问题