?
Solved

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

Posted on 2005-03-24
8
Medium Priority
?
205 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
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 26

Expert Comment

by:Eddie Shipman
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:
Eddie Shipman 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:Eddie Shipman
ID: 13644278
What did you find out, Shane?
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
There may be issues when you are trying to access Outlook or send & receive emails or due to Outlook crash which leads to corrupt or damaged PST file. To eliminate the corruption from your PST file, you need to repair the corrupt Outlook PST file. U…

621 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