Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Tricking Websites with cookies, etc.  RSS feed

 
William Fretts-Saxton
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey all,

I'm currently writing an application that reads and parses web pages from a site. I am a member of this site, however, the server doesn't know this when my application talks to it. I've checked my cookies for all of the cookies set by the site, and used:


URL myURL = new URL("http://www.blahblah.com");
URLConnection myConn;

myConn = myURL.openConnection();
myConn.setRequestProperty("Cookie", "A=foo; B=bar");
myConn.connect();


When I print out the inputstream, however, it get the page that says I'm not a member.
 
William Fretts-Saxton
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also added these entries, and still nothing:

myConn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461)");
myConn.setRequestProperty("Referer", "http://www.blahblah.com");
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!