?
Solved

Connecting to a website and maintaining a sesion.....?

Posted on 2005-03-24
8
Medium Priority
?
197 Views
Last Modified: 2011-10-03
I am using delphi 7 Enterprise.

I have a web page where I am a member of (I have a User ID & password). Is it possible to connect to that page from a Delphi Application and maintain a session with it. The reason I ask, is I want to retrieve info from the site for my application.

If So, what components do I use, and How?

This Question will start of with 125 points, but will be increased if its possible to accomplish the feat, and I get some code help!

sholmes
0
Comment
Question by:shaneholmes
[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
8 Comments
 
LVL 7

Expert Comment

by:DavidBirch2dotCom
ID: 13624418
I think you need to check on cpoy right issues...

but the problem is most likely to be the lack of a cookie - though quite how you would send it I am not sure
0
 
LVL 11

Author Comment

by:shaneholmes
ID: 13624496
Sorry, forgot to post the code im using....

Using Indy,

This is what I have right now:

var
 Params: TStringList;
begin
 Params := TStringList.Create;
 Params.Add('username=' + edtUserName.Text);
 Params.Add('password=' + edtPassword.Text);
 HTTP.Post('http://www.geocaching.com/login/default.aspx?RESET=Y&redir=http%3a%2f%2fwww.geocaching.com%2fDefault.aspx', Params);
 Memo.Text := HTTP.Get('http://www.geocaching.com/Default.aspx');
 Params.Free;
end;

sholmes
0
 
LVL 11

Expert Comment

by:ZhaawZ
ID: 13624796
Hmm.. Isn't it possible to read headers (of homepage) with Indy components? And what about cookies (session variable is usually stored as cookie)?
I don't have Indy, so I can't provide you with exact code.
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 26

Expert Comment

by:EddieShipman
ID: 13630136
Shane, seeing that it is an ASP.Net site, I would suspect that they are using ASP SessionIDs which can be very
tricky. When you maneuver in the site do you see your sessionid at the end of the URLs? If not, then
they may be using a cookie.

I'd get a packet sniffer to see exactly what they are sending, get a good one here:
http://www.ethereal.com/
0
 
LVL 11

Author Comment

by:shaneholmes
ID: 13630257
Here is what the end of each url looks like:

This is the page url

http://www.geocaching.com/

This is the login page url

http://www.geocaching.com/login/default.aspx?RESET=Y&redir=http%3a%2f%2fwww.geocaching.com%2fDefault.aspx


This is the url after a successful login

http://www.geocaching.com/Default.aspx


A successful loging would have a different page then a unsuccessful login


sholmes
0
 
LVL 26

Accepted Solution

by:
EddieShipman earned 500 total points
ID: 13630498
Then I really suggest getting EtherReal to capture what the host is sending. It will
help you figure out if they are using Cookies or what other session stuff they may
be using.
0
 
LVL 11

Author Comment

by:shaneholmes
ID: 13630723
k - i'll try it and see what i can do woth it.

sholmes
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 13644278
What did you find out, Shane?
0

Featured Post

Independent Software Vendors: 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!

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

764 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