当Android中整合Twitter的标题无效饼干 [英] Invalid header cookie when integrate twitter in android

查看:172
本文介绍了当Android中整合Twitter的标题无效饼干的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经整合微博Android版使用<一个href="http://blog.doityourselfandroid.com/2011/02/13/guide-to-integrating-twitter-android-application/">this教程

I've integrated Twitter for Android using this tutorial

它用于正常运行,但突然就开始出现以下错误:

It used to run normally, but suddenly it started showing the following error:

05-23 23:17:12.492:W / ResponseProcessCookies(17376):无效的cookie   头:设置Cookie:guest_id = V1%3A136932583219426033;   域名= .twitter.com;路径= /;过期=周六,23月 - 2015年16点17分十二秒UTC。   无法解析到期属性:周六,23月 - 2015年16时17分十二秒UTC

05-23 23:17:12.492: W/ResponseProcessCookies(17376): Invalid cookie header: "set-cookie: guest_id=v1%3A136932583219426033; Domain=.twitter.com; Path=/; Expires=Sat, 23-May-2015 16:17:12 UTC". Unable to parse expires attribute: Sat, 23-May-2015 16:17:12 UTC

显示登录页面在浏览器中,并开始登录后,它显示了一个授权页面。当我尝试从这个网页授权,我不能回到我的应用程序,如我的预期。我该如何解决这个问题?

After showing the login page in a browser and starting to login, it shows an authorize page. When I try to authorize from this page, I am not returned to my application like I expected. How can I fix this?

推荐答案

您到期需要使用以下格式:

Your expires needs to be in the format:

Sat, 23 May 2015 16:17:12 GMT

失去破折号和你的TZ需要在格林尼治标准​​时间。

Lose the dashes and your TZ needs to be GMT.

假设你正在使用的SimpleDateFormat,这相当于格式字符串:

Assuming that you are using SimpleDateFormat, this is equivalent to the format string:

"EEE,  d MMM yyyy HH:mm:ss zzz"

要设置时区为GMT:

formatter.setTimeZone(TimeZone.getTimeZone("GMT"));

这篇关于当Android中整合Twitter的标题无效饼干的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆