progmatic Form post (HttpWebRequest / Response) sessions

R

Ron Vecchi

I know this has messiness written all over it but I have a question about
using HttpWebRequest/Response to essentially spider a website and post
information to the forms. The (very) basic goal is to progmattically
access a login account by posting the username and password and then
maintaining the session so that the program can continue to access web pages
that require a valid login sesssion.

The big if for me is maintaining the session thoughout all this so the
server recognizes me after the initial post to gain access. Two scenariaos
come to play.
--------------
If the server maintains the sessions(no cookies) I am uneasily predicting
that session state will remain fine.
--------------
If cookies are used I am a little sceptical on how to maintain state. If I
can access the cookie then it will need to be stored in memory and
retransmitted back to the server on the next access.


Has anyone tried this and got it to work. Or any insight is defiunatly
appreciated.

Thanks,
Ron
 
C

Cliff Harris

We have done this here...
And we had to do exactly what you described in your second scenerio. We
caught all coookies that were sent to us when we logged on, and then with
each subsequent request, sent along the cookies as well.
It wasn't fun, but it worked.

HTH,
-Cliff
 
R

Ron Vecchi

Another thing came to mind, if one of the webpages checks to amke sure a
Referrer is present in the Request. Is there a way to programmically add in
a referrer to the HttpRequest before sending?

Thanks!
 
C

Cliff Harris

Yeah, we had to do that as well.. there is a propery of the response object
where you can just set it

-Cliff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,139
Latest member
JamaalCald
Top