Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cookies in java application

 
Jan Andersson
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm writing a small Java application that logs in to my mail.com webmail account and retrives the new message headers if any.
By http POSTing I've managed to log in but the webmail service relies on a cookie being present. So when I try to GET the page on which the new mails are listed mail.com thinks I'm logged out since it can't read the cookie.
How to I manage cookies in Java? It should be possible since there are Java web browsers (i think...).
Greatful for any tips and ideas!
/Jan Andersson
 
Joe Gilvary
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You pass cookies back and forth in HTTP headers.
Look at the examples in the old rfc at
http://www.ietf.org/rfc/rfc2109.txt
HTH,
Joe
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Jan Andersson,

If you'd be willing, I'd appreciate a look at your code. That sounds like a great application to have.

Thank You,
-Dirk Schreckmann
 
Jan Andersson
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aha, that RFQ should do it... So subsequent requests after logging in should include:

maybe...?

Dirk: No problem. But right now it doesn't do much besides logging in. I need to fix this cookie thing before seeing any results. I´┐Żll get back to you then.
[ February 22, 2002: Message edited by: Jan Andersson ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic