Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid header cookie when integrate twitter in android

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?

like image 294
user1920582 Avatar asked May 23 '13 16:05

user1920582


1 Answers

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"));
like image 180
Erik Nedwidek Avatar answered Nov 17 '22 23:11

Erik Nedwidek