[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Values to site using cookies

Posted on 2004-09-30
10
Medium Priority
?
313 Views
Last Modified: 2010-03-31
Hi,

I had a post similiar to this and it got stuck so i'm posting another here.

I tried to send values from a java application to the following site:
http://websms.starhub.com/websms/sendSMS/index.jsp

but it doesn't work. I've checked the http and POST/GET request and found that it sent its values to another server somewhere else.

GET http://server-sg.imrworldwide.com/a1.js HTTP/1.0

Accept: */*

Referer: http://websms.starhub.com/websms/session/p_checkSession3.jsp?nR=6591838845&n=testname

It seems that it requires cookies to pass through but i have no idea on how to do it.
So is there anyone that can help and try on that site?

last post: http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_21138679.html
0
Comment
Question by:TPoly
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +2
10 Comments
 
LVL 12

Accepted Solution

by:
Giant2 earned 500 total points
ID: 12187750
0
 
LVL 35

Assisted Solution

by:TimYates
TimYates earned 500 total points
ID: 12187770
I would use HttpClient... It handles cookies and forwarding and everything for you...

http://jakarta.apache.org/commons/httpclient/

I'll post an example when I get to work...

0
 
LVL 1

Assisted Solution

by:frank_van_puffelen
frank_van_puffelen earned 500 total points
ID: 12187784
I'm not entirely sure if I understand you correctly, so please excuse me if my comment doesn't make sense.
If you're trying to send a cookie to a server that you're accessing through a URLConnection, you can set the cookie as a request property.
   urlConn.setRequestProperty("Cookie", cookieString);
Of course since these are coookies you can have multiple values in that single cookieString. That why you'll find a nice function on http://www.rgagnon.com/javadetails/java-0092.html

If you're trying to accomplish something else, then please provide a small code sample so I can see what you're working on.
If it's related to that specific SMS sending side, then I'm afraid I can't be of much help.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Expert Comment

by:frank_van_puffelen
ID: 12187790
Giant beat me to it.

Tim's suggestion could also work, but requires you to use a different library that's not anywhere near a drop-in replacement for Sun's HTTP client. But the Apache commons-httpclient is a very good implementation, so you might indeed want to consider it.
0
 
LVL 92

Assisted Solution

by:objects
objects earned 500 total points
ID: 12187838
to get the cookie value:

String cookie = connection.getHeaderField("set-cookie");

then to set it in subsequent request:

connection.setRequestProperty("cookie", cookie);
0
 
LVL 13

Expert Comment

by:Webstorm
ID: 12189096
Hi all,

>> GET http : / /server-sg.imrworldwide.com/a1.js HTTP/1.0
The  *.imrworldwide.com  domain name is used by the "Red Sherriff" spyware (see http://cexx.org/sheriff.htm).

0
 
LVL 13

Expert Comment

by:Webstorm
ID: 12189174
0
 
LVL 12

Expert Comment

by:Giant2
ID: 12189209
Webstorm,
what are you posting in this thread?
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question