为Twitter设计,Cookie溢出错误? [英] Devise for Twitter, Cookie Overflow error?
问题描述
我正在使用这个指南将twitter集成到设计中。我基本上都是采用Facebook的所有事情,并用twitter取代它。但是,当我使用twitter登录时,我收到以下错误:
ActionDispatch :: Cookies :: CookieOverflow(ActionDispatch: :Cookie :: CookieOverflow):
在以下网址:
http:// localhost:3000 / users / auth / twitter / callback?oauth_token = something& oauth_verifier = blah
/ pre>
有没有什么好办法解决这个问题?
谢谢!
解决方案问题在于
session [devise.facebook_data] = env [omniauth.auth]
。 Twitter的响应包含非常大的额外
部分,不适合会话。一个选项是在会话中存储env [omniauth.auth]。except(extra)
。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 am getting the following error:
ActionDispatch::Cookies::CookieOverflow (ActionDispatch::Cookies::CookieOverflow):
at the following url:
http://localhost:3000/users/auth/twitter/callback?oauth_token=something&oauth_verifier=blah
Is there any nice way to get around fixing this problem?
Thanks!
解决方案The problem is with
session["devise.facebook_data"] = env["omniauth.auth"]
. Twitter's response contains anextra
section that is very large and does not fit in the session. One option is to storeenv["omniauth.auth"].except("extra")
in the session instead.这篇关于为Twitter设计,Cookie溢出错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!