$20 to anyone who can help: (I think) how to send the right cookie info
Yes, we're so befuddled and stumped that we are willing to pay $25 by Paypal or any other method (check, money order) to the first person who provides us with a concrete solution that allows us to read this page through a Java application:
http://s1.amazon.com/exec/varzea/subst/your-account/your-open-marketplace-items.html/104-3907538-7794313
The problem (we think) seems relatively simple: how can we pass the correct cookie to a server? We want to search our merchant web pages on amazon.com (and perform other operations, but for the purposes of this problem, just assume we want to read the above web page). We wrote a variation of a webcrawler which works fine on most web pages. However, the Amazon web pages we want to crawl (i.e., http://s1.amazon.com/exec/varzea/subst/your-account/your-open-marketplace-items.html/104-3907538-7794313) require you to sign in first (otherwise you get redirected to http://s1.amazon.com/exec/varzea/subst/your-account/your-won-zshop-items.html/104-0793551-2976761). So we thought that this meant we had to figure out how to get our webcrawler to login first (we implemented the Java Almanac example for accessing password-protected URLs: http://javaalmanac.com/egs/java.net/Auth.html?l=rel). During the course of testing this out (the code seemed to work, though we still got redirected), we realized that the Amazon web page is not actually performing basic authentication (not asking for username/password), but instead seems (that is, seems to inexperienced us) to be looking for a cookie. We believe this because after we sign in to Amazon, we can access all our merchant web pages just fine without ever needing to log in, even if we turn off the browser (or computer). Also, if we try to access the web page after deleting all cookies, we again get redirected to the page requesting that we sign in.
So we took a look at the Amazon cookie that was created after we signed in to Amazon (printed below), and then implemented the cookie-passing code from the Java Almanac (http://javaalmanac.com/egs/java.net/SendCookie.html). This seemed to have no effect:we still got redirected. We hunted around for other Cookie examples and found achase1's example from a previous forum question (http://forum.java.sun.com/thread.jsp?forum=54&thread=375956), which seemed to add a few HTTPUrlConnection.set's, but this also had no effect--our Java crawler still gets redirected to the page that requests that we sign in first.
So we think that either we are somehow passing the wrong cookie information, or are just missing some critical HttpURLConnection setting or parameter.
So, if you can tell us how to read the Amazon page that seems to require a cookie, and your explanation actually works (that is, we can read the page), we will send you $25 immediately--like so many others on the forum, we're frustrated and lost and need an answer that works!
Here is the Amazon account information (naturally, this is a working dummy account on Amazon, not our actual account, in case you want to test your solution before posting it):
username: [email protected]
password: melville
Here is the cookie that is generated:
session-id
104-3907538-7794313
amazon.com/
1536
3382951936
29569409
1475475408
29568127
session-id-time
1055491200
amazon.com/
1536
3382951936
29569409
1475575408
29568127
ubid-main
430-1017936-7312154
amazon.com/
1536
2916341376
31961269
1482485408
29568127
x-main
Z3yciaQAfpzN?CPFkzeRd8z1U2lWcoap
amazon.com/
1536
2916341376
31961269
2005235408
29568127
Here is the extra-simplified version of our webcrawler, which simply tries to read (and print out) the web page:
import java.net.*;
import java.io.*;
public class PasswordReader {
public static void main(String[] args) throws Exception {
// Try to access the page
try {
HttpURLConnection m_urlConn;
URL url = new URL(args[0]);
// Cookie passing code
m_urlConn=(HttpURLConnection)url.openConnection();
m_urlConn.setDoOutput(true);
m_urlConn.setDoInput(true);
m_urlConn.setUseCaches(false);
m_urlConn.setRequestMethod("POST");
// optrional
m_urlConn.setRequestProperty("User-Agent","Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; H010818)");
m_urlConn.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
m_urlConn.setRequestProperty("Cookie" , "session-id=104-3907538-7794313;session-id-time=1055491200;ubid-main=430-1017936-7312154;x-main=Z3yciaQAfpzN?CPFkzeRd8z1U2lWcoap");
m_urlConn.connect();
// end cookie code
BufferedReader in = new BufferedReader(
new InputStreamReader(
url.openStream()));
String inputLine;
// Read and print out the web page
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);
in.close();
} catch (MalformedURLException e) {
} catch (IOException e) {
Thank so much to anyone who even tries to help us!! We've been poring through the Sun forums, almanacs, and sample code all week without much evident progress. You'd really be making us very, very happy.
Thank you,
Ogi Ogas
[email protected]
"{[VERSION="0" ; NAME="session_id" ; VALUE="@@33f84622845133891a68ec0dffe9f620" ; DOMAIN="my.asu.edu" ; PATH="/" ; SECURE="false" ; EXPIRES="null"]}"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~The Cookie!
<HTML><HEAD><!--set cookie-->
<SCRIPT language='JavaScript'><!--
document.cookie = "session_id=@@33f84622845133891a68ec0dffe9f620; path=/;";
// Begin JavaScript
if(!document.cookie) {
var agt=navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);
// Note: Opera and WebTV spoof Navigator.
var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
&& (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
&& (agt.indexOf('webtv')==-1));
var is_nav2 = (is_nav && (is_major == 2));
var is_nav3 = (is_nav && (is_major == 3));
var is_nav4 = (is_nav && (is_major == 4));
var is_nav4up = (is_nav && (is_major >= 4));
var is_navonly = (is_nav && ((agt.indexOf(";nav") != -1) ||
(agt.indexOf("; nav") != -1)) );
var is_nav5 = (is_nav && (is_major == 5));
var is_nav5up = (is_nav && (is_major >= 5));
var is_ie = (agt.indexOf("msie") != -1);
var is_ie3 = (is_ie && (is_major < 4));
var is_ie4 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")==-1) );
var is_ie4up = (is_ie && (is_major >= 4));
var is_ie5 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
var is_ie5up = (is_ie && !is_ie3 && !is_ie4);
// KNOWN BUG: On AOL4, returns false if IE3 is embedded browser
// or if this is the first browser window opened. Thus the
// variables is_aol, is_aol3, and is_aol4 aren't 100% reliable.
var is_aol = (agt.indexOf("aol") != -1);
var is_aol3 = (is_aol && is_ie3);
var is_aol4 = (is_aol && is_ie4);
var is_opera = (agt.indexOf("opera") != -1);
var is_webtv = (agt.indexOf("webtv") != -1);
var intro_dir = "This installation of Blackboard 5 requires the acceptance of a cookie by your browser software. ";
intro_dir += "The cookie is used to ensure that you <I>and only you</I> are able to access information in the courses, assessments, gradebooks and other features which are appropriate for you. <P>";
intro_dir += "The system has been unable to place the cookie. This may be because cookies are disabled in your browser.<P> To enable cookies in your browser:<ol>";
var nn4dir = "<LI>Select <I>Preferences</I> from your browser's Edit Menu. <LI>Select <I>Advanced</I> from the list in the left-hand pane of the dialog box. ";
nn4dir += "<LI>Under the <I>Cookies</I> box, select either of the first two options ('Accept all cookies' or 'Accept only cookies that get sent back to ";
nn4dir += "the originating server')<LI>Click 'Ok' to close the dialog box. ";
var ie5dir = "<LI>Select <I>Internet Options</I> from your browser's Tools Menu <LI>Select the <I>Security</I> Tab, and click on the 'Custom Level' button. ";
ie5dir += "<LI>Scroll down to the 'Cookies' Section, and select either of the last two options under 'Allow Per-Session Cookies (not stored)' - either 'Enable' or 'Prompt'. ";
ie5dir += "<LI>Click 'Ok' to Close the Security Settings dialog box. ";
ie5dir += "<P><B>NOTE</B> Depending on your institution's set-up of Blackboard 5, you may need to repeat steps 3 & 4 for more than one 'Security Zone'. ";
ie5dir += "<BR>For example, if you are connecting from a computer inside the same firewall or network as the Blackboard 5 machine, you would select the 'Local Intranet Zone'. ";
ie5dir += "<BR>If you are making a connection across the internet from another location, you would select the 'Internet Zone'. <BR>In some cases, you may need to do both.<P>";
ie5dir += "<LI>Click 'Apply' and 'Ok' to close the Internet Options dialog box.";
var ie4dir = "<LI>Select <I>Internet Options</I> from your browser's Tools Menu <LI>Select the <I>Advanced</I> Tab. ";
ie4dir += "<LI>Scroll down to the 'Cookies' Section under 'Security', and select either the first or last option - either 'Prompt before Accepting Cookies' or 'Always Accept Cookies'. ";
ie4dir += "<LI>Click 'Apply' and 'Ok' to close the Internet Options dialog box.";
var browser_dir = "<LI>Please follow your browser's Help instructions for enabling Session (non-stored) cookies that are sent back to the originating server.";
if (is_nav) { browser_dir = nn4dir; }
if (is_ie5up) { browser_dir = ie5dir; }
if (is_ie4) { browser_dir = ie4dir; }
browser_dir += "<LI>Click 'Ok' on this page to return to Blackboard 5.";
document.write("<table border='0' width='100%' cellpadding='0' cellspacing='0'><tr><td align='left' width='40'> </td>");
document.write("<td align='left' width='100%'><b><font face='Arial, Helvetica, sans-serif' size='4'>Browser Cookies Disabled</font></b><hr size=5 noshade></td></tr></table>");
document.write("<table border='0' cellpadding='5' cellspacing='0' width='100%'><tr><td width='20' valign='top'> </td><td width='100%' valign='top'>");
document.write("<font face='Arial, Helvetica, sans-serif' size='2'><b>Browser Cookies Disabled</b></font><br>");
document.write("<font size='2' face='Arial, Helvetica, sans-serif'>"+intro_dir);
document.write(browser_dir);
document.write("</font><br></td></tr><tr><td colspan='6' align='center'><form><input type=button value='Ok' onclick='javascript:history.go(-1)'></td></tr></table></form>");
} else {
var href = document.location.href;
href = href + "?bbatt=Y";
document.location.href = href;
//END JavaScript
//--></SCRIPT>
</HEAD><BODY BGCOLOR='FFFFFF'>
</BODY><HTML>
Similar Messages
-
I think pesimo customer service three days, I'm looking for someone I can ayudr activation problem with my CC and can not find anyone who can help me.
Online Chat Now button near the bottom for Activation and Deactivation problems may help
http://helpx.adobe.com/x-productkb/policy-pricing/activation-deactivation-products.html -
I have installed ios7 on my iPad 4. After installation it asked me a pass code which I have never set. After multiple attempts it is disabled. I don't have backup on my iCloud or iTunes. Is there anyone who can help to enable it or to reverse iPad to ios6. I asked Apple store & tech said to format it but I will lose all the data..!
Thanks for that. Much more constructive than the last comment. It's only the restriction code I can't recall, not the access passcode. So I can currently access the device, just not age restricted content. Does that's make a difference? I also wondered if anyone knew how many attempts you get to try to get it right. Now tried 21 times and so far nothing bad has happened but I am concerned I'll eventually be completely locked out of the device. That doesn't seem in the spirit of things though. Surely it's foreseeable that a child could repeatedly try to guess the code so I can't see that it would be right to lock the device down completely in that circumstance, particularly if the access code is being typed in correctly every time.
Thanks -
I have a MacBook Pro, 15-inch, Mid 2009. I would love to upgrade to a Solid State Drive. What is the best possible upgrade I can buy. I need the specs and even brand name. Thank you to anyone who can help.
A 15" mid-2009 MBP RAM specifications are: 204-pin PC3-8500 (1066 MHz) DDR3 SO-DIMM.
As has been pointed out, OWC is an excellent source for Mac compatible RAM. Crucial is another first rate source for Mac RAM. RAM from either vendor will work just as well as any purchased from Apple with the bonus of being less expensive and having a lifetime guarantee.
Ciao. -
hi i was wondering can i buy a macbook pro 13 inch. with a 500 GB hardrive that costs 50 dollers more im gonna buy the one that costs 1200 dollers anyone who can help me? i know that can do it online but i was wondering can i buy it like that at the store
anton93 wrote:
hi i was wondering can i buy a macbook pro 13 inch. with a 500 GB hardrive that costs 50 dollers more im gonna buy the one that costs 1200 dollers anyone who can help me? i know that can do it online but i was wondering can i buy it like that at the store
Call the store & ask them! -
I have a problem, i can't change my lockscreen wallpaper? Doesnt work...is there anyone who can help me regarding this problem? Thx
To help, we need more detailed information.
--What steps are you trying?
--What does the device tell you (any pop-ups or messages)?
--Are you able to change the Home screen wallpaper, or is that affected too?
--Are you the phone's owner/administrator, or is this a device used for work (assigned/administered by IT staff, possible on an Exchange server)?
--Have you jailbroken the device? -
Hi everyone,
See picture below. Part of a large form I made for work. Got a little problem though. Adding a new row with the button 'add a new revision' is working perfect (also when saved and reopened). But when I add amendments with the + button on the right (a,b,c), these disappear when I save and reopen the file. Anyone who can help?
Thanks!Ok, I've checked your form and there are some problem in your design.
You should use better namings for your objects!
It makes no sense to name to tables with repeatable instances the same.
This can cause problems with repeated objects and also requires the usage of the slow resolveNode() method.
I've changed a few object names and so I where able to shorten many of your current scripts.
https://files.acrobat.com/a/preview/7b4655fb-feea-4d55-896e-83317605ee19 -
Please anyone who can help me in unlocking or openlin with my iphone 4
please anyone who can help me in unlocking or openlin with my iphone 4 its been months but i never get use it...version 5.1.1
<Edited by Host>Only the carrier to which your phone is locked to can unlock it provided that the carrier offers this service. Contact your carrier for unlocking.
-
Is there anyone who can help me? my Photoshop CC is keep crashing, it doesn't show any error message. Suddenly " program stop responding" after few seconds of launch.
If Photoshop crashes the should be a System crash report generated by your OS. For example Windows
-
Is there anyone who can help me to design a index page
Hi guys
I would like to design a index page like this site :
http://www.hostplate.com
Is there anyone who can help me ?Your example site is built with WordPress (a popular open source framework).
You'll need to have a good working knowledge of HTML, CSS and some familiarity with PHP code & the ability to set-up a MySql database on your server. The good news is that there is a wealth of on-line information available to you.
HTML, CSS, PHP Tutorials - http://w3schools.com/
Getting Started with WordPress - http://codex.wordpress.org/Getting_Started_with_WordPress
If all this is outside your comfort zone and you're prepared to hire an experienced web developer to help you,
feel free to contact me through my web site: http://alt-web.com
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
http://alt-web.com/
http://twitter.com/altweb -
Hey. I can not sync my iphone with my macbook air. It will not download my purchased music. Writes that there was an unknown error (-42408). Is there anyone who can help me.
Sincerely jimmiHey joshuafromisr,
If you resintall iTunes, it should fix the issue. The following document will go over how to remove iTunes fully and then reinstall. Depending on what version of Windows you're running you'll either follow the directions here:
Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP
http://support.apple.com/kb/HT1925
or here:
Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7
http://support.apple.com/kb/HT1923
Best,
David -
How do I make Internet commerce with the MacBook Pro in the program iWeb. I've made the website and would like to ad a site where it possible to commerce with debit cards. Is there anyone who can help?
Some info on this and the following two pages...
http://www.iwebformusicians.com/Internet-Music-Sell-Distribute/Website-Buy-Page. html
"I may receive some form of compensation, financial or otherwise, from my recommendation or link." -
My ipod nano 6th Gen. bought 5th Jan 2011 suddenly cannot be switched on. Last use is just 3h ago and everything went perfect til then Even shows no reaction when connected to charging cable. Anyone who can help?
See the Will not turn or screen remains dark section of this Apple support document to start troubleshooting the issue.
iPod nano (6th generation): Hardware troubleshooting
B-rock -
Screen frozen, anyone who can help?
Screen frozen on Ipad Gen 3 ...any one who can help?
Try to double click the home button then upswipe the app closed. If that doesn't work a reset will. Press and hold both the home and power buttons 10-15 seconds until the Apple logo appears. Release both fingers. Wait 15-20 seconds until your iPad starts on it's own.
-
Why the apple store taken more amount more than the amount written on their prices? Is there any one who can help me to contact the apple customer services. Thanks!
Some country's might not include tax in their prices, and if you changed or added your credit card details whilst making the purchase then a small temporary holding charge may also have been placed - in which case that should disappear within a few days (http://support.apple.com/kb/HT3702). Some apps also then allow you to make in-app purchases (though you can disable that via Settings > General > Restrictions)
Maybe you are looking for
-
Enter condition type several times in a sales order
Hello Gurus, I have a Pricing Procedures with net price minus some discounts and sales price. This is standard. One of the discount condition types you can enter manually in a sales order. Now my problem. This discount condition type you can enter s
-
Defining attribute for internal table within class builder?
Hello there, I use an function module that provides me an internal table which has the reference type of the DDIC object zml_output. Furthermore I call this function module within a global class that should keep the result of the function module into
-
Accounts Payable - Check Printing
Hi Guys, While running the Payment Program, checks are printing in the order of Vendor Number. How to change the sequence to Vendor Name so that the checks are printed in the alphabetical order. Thanks in Advance Madhu Vutukuri
-
Hi, I am trying to drop a nuser in my database (it owns no objects). But my "drop user....;" command just hangs. Any ideas on what might be wrong. My database version is 9.2.0.5 on Solaris 9. I see no error messages in alert log, nor is there any tra
-
SSRS Log shows Reporting web server started, was it closed before?
Hi there: During the weekend, one of our sql jobs that calls a RSS script to create a SSRS PDF report failed The job error says " Could not connect to server: http://XXXXXXXXX/ReportServer/ReportService2005.asmx " The command inside