473,326 Members | 2,127 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

progmatic Form post (HttpWebRequest / Response) sessions

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
Nov 18 '05 #1
4 1519
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

"Ron Vecchi" <ve******@online.nospam> wrote in message
news:uc*************@TK2MSFTNGP10.phx.gbl...
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

Nov 18 '05 #2
Glad to hear it worked Cliff.
Thanks for the info

"Cliff Harris" <he***@myrealbox.com> wrote in message
news:Oe**************@TK2MSFTNGP12.phx.gbl...
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

"Ron Vecchi" <ve******@online.nospam> wrote in message
news:uc*************@TK2MSFTNGP10.phx.gbl...
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


Nov 18 '05 #3
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!

"Cliff Harris" <he***@myrealbox.com> wrote in message
news:Oe**************@TK2MSFTNGP12.phx.gbl...
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

"Ron Vecchi" <ve******@online.nospam> wrote in message
news:uc*************@TK2MSFTNGP10.phx.gbl...
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


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

-Cliff

"Ron Vecchi" <ve******@online.nospam> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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!

"Cliff Harris" <he***@myrealbox.com> wrote in message
news:Oe**************@TK2MSFTNGP12.phx.gbl...
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

"Ron Vecchi" <ve******@online.nospam> wrote in message
news:uc*************@TK2MSFTNGP10.phx.gbl...
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



Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Rachet? | last post by:
I am getting a "The remote server returned an error: (400) Bad Request." error while trying to send data to an asp page. The puzzle is, if I paste the string I want to send on a browser address...
14
by: John A Grandy | last post by:
has anyone successfully used HttpWebRequest or WebClient class to simulate submission of a simple HTML form? for example: a very simple plain-vanilla form with a textbox and a button. when the...
9
by: Denise | last post by:
I have posted a similar message in 2 other forums but got no response. I have spent more hours than I can count researching this. Can anyone provide some insight...? Our ASP.Net application...
3
by: Tony Hunter | last post by:
Hello, I am trying to automatically login to websites after I have used SSO to get the credentials. For my test, I am working with my Yahoo account. The code that I am using is code that many...
1
by: logik3x | last post by:
I'm developping a program to automate the submisson of grades to a website called omnivox.ca (http://brebeuf.omnivox.ca). My problem is that I can't get the login working. I get the cookie right...
4
by: Natalia | last post by:
Hello, I need to provide the ability to post file and some form elements via our website (asp.net) to the third party website (asp page). On http://aspalliance.com/236#Page4 - I found great...
0
by: shlim | last post by:
Currently I'm using VB.Net to perform a http/https multipart form post to a servlet. I'm able to perform the post using HttpWebrequest via GetRequestStream(). However, the servlet returned me with...
1
by: ERobishaw | last post by:
Using Winform app writing a HTTP Post using the following... on the server side, I get no form fields. Request.Form.AllKeys.Length = 0. If I put the field/value paris in the URL I can use...
5
by: mcfly1204 | last post by:
I am attempting to use WebRequest to access a page that requires a login/password to access. My last WebRequest continues to timeout. Any help or thoughts would be appreciated. namespace...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.