This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Accessing a URI from a program and checking cookies enabled
SAFROLE YUTANI
Ranch Hand
Joined: Jul 06, 2001
Posts: 257
posted
0
I have a simple program that submits a POST request to a web site. The page being accessed is a LogIn page. I have configured the request from my program to set all the request parameters and HTTP headers that would be set if the user was using a regular browser in order to fool the web site into thinking the request originated from a browser. When the request is made, the web site responds with content which, after dumping to a flat file, produces a page which instucts the user that their browser must be set to accept cookies. I can't understand how the web site determined that I did not have cookies enabled. From the servers perspective, you need at least 1 1/2 rounds trip requests in order to determine if the browser has cookies enabled. In the first reponse, the web site will send a "Set-Cookie" header containing a sessions id which instructs the browser to resend this header for all subsequest requests. But in my case, I never see the "Set-Cookie" header, not even in the first response. I'm definitely looking for it, but I never see it. The server must have a method for determining if cookies are enabled or not, even before the first response if committed, but there must be a way to fool the server.
William Brogden
Author and all-around good cowpoke
Rancher
Hi William, I downloaded the HttpClient toolkit from Jakarta and installed it. I ran my test using a sample program from the Jakarta site and I still get the same response as I did when I submitted the request from my own custom program. I still get the HTML screen indicating that cookies are not enabled on the first request. Weird. Which type of CookiePolicy do you use? I tried them all. Thanks
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: Accessing a URI from a program and checking cookies enabled