File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes cookies in java application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "cookies in java application" Watch "cookies in java application" New topic
Author

cookies in java application

Jan Andersson
Greenhorn

Joined: Nov 19, 2001
Posts: 5
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


/jan
Joe Gilvary
Ranch Hand

Joined: May 11, 2001
Posts: 152
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

Joined: Dec 10, 2001
Posts: 7023
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


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Jan Andersson
Greenhorn

Joined: Nov 19, 2001
Posts: 5
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 ]
 
 
subject: cookies in java application