• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HTTP and Cookies

 
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I'm trying to provide Hotmail viewing to the general public. It seems I have to get it from their HTTP server. I get stopped because Hotmail is not detecting any cookie support. How would I show them there is cookie support if I'm using JSP or servlets?
I tried the following with failure:
<code>
//--- I have to login first with url_1 then handle the cookie problem with url.
URL url_1 = new URL("http://lc1.law5.hotmail.passport.com/cgi-bin/dologin?login=test&passwd=testpass&svc=mail&curmbox=ACTIVE&js=no&_lang=EN&beta=&ishotmail=1&id=2&ct=995326063&RemoteDAPost=https:/ /login.msnia.passport.com/ppsecure/post.asp");
// with the above I did pretty much the same below----------
URL url = new URL("http://lw2fd.hotmail.msn.com/cgi-bin/HoTMaiL?curmbox=F000000001");
URLConnection connection = url.openConnection();
connection.setDoOutput(true);
PrintWriter outt = new PrintWriter( connection.getOutputStream());
outt.println("User-Agent Mozilla/5.0");
// I just copied out the cookie contents from a previous session
outt.println("Cookie: me=HMP1\n1\nhotmail.msn.com/\n0\n1715111808\n32157852\n1307580328\n29404042\n*");
outt.close();
BufferedReader in = new BufferedReader(
new InputStreamReader(
connection.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
out.println(inputLine);
in.close();
</code>
Any help would be greatly appreciated.
Yoo-Jin.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic