Invalid header cookie when integrate twitter in android

跟風遠走 提交于 2019-12-30 08:40:30

问题


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): 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?


回答1:


Your expires needs to be in the format:

Sat, 23 May 2015 16:17:12 GMT

Lose the dashes and your TZ needs to be GMT.

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

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

To set the timezone to GMT:

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


来源:https://stackoverflow.com/questions/16719134/invalid-header-cookie-when-integrate-twitter-in-android

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!