Devise for Twitter, Cookie Overflow error?

后端 未结 2 1295
伪装坚强ぢ
伪装坚强ぢ 2021-01-31 09:49

I am trying to integrate twitter into devise using this guide. I basically take all occurence of facebook and substitue it with twitter. However, when I sign in with twitter, I

相关标签:
2条回答
  • 2021-01-31 09:56

    You can turn on ActiveRecord store for session. Look in config/initializers/session_store.rb

    comment out the line about using :cookie_store

    uncomment the lines at the bottom about using :active_record_store

    # Use the database for sessions instead of the cookie-based default,
    # which shouldn't be used to store highly confidential information
    # (create the session table with "rails generate session_migration")
    MyApp::Application.config.session_store :active_record_store
    

    Create migration before rails rails g session_migration and migrate it.

    0 讨论(0)
  • 2021-01-31 10:14

    The problem is with session["devise.facebook_data"] = env["omniauth.auth"]. Twitter's response contains an extra section that is very large and does not fit in the session. One option is to store env["omniauth.auth"].except("extra") in the session instead.

    0 讨论(0)
提交回复
热议问题