473,396 Members | 1,998 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,396 software developers and data experts.

Help...Replicating IE HTTP protocol to communicate with ASP.NET

Hi,

We have an ASP.NET web application which is suffering performance
problems. Since setting up robot scripting interacting with the
browser would take a while I hoped I could open a two-way socket with
IIS and replicate the HTTP session information e.g. starting out with

POST /192.168.1.1/login.aspx HTTP/1.1\r\n
Accept-Language: en-us\r\n
ontent-Type: application/x-www-form-urlencoded\r\n
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET
CLR 1.0.3705)\r\n
Host: 192.168.1.1\r\n
ontent-Length: 68\r\n
Connection: Keep-Alive\r\n
Cache-Control: no-cache\r\n
Cookie: ASPSESSIONIDAAATDTQR=OGEFBLJCPEPCNFHMJGPHBCDJ;
ASP.NET_SessionId=ko3ozjqyqb1lbu454cxrf3ft;\r\n
\r\n__EVENTTARGET=&__EVENTARGUMENT=&usersid=abcde& passwd=12345&test=Login
When I network sniff IE I see the ASPSESSIONIDAAADTQR, without it I
get a security timeout from the server. I could probably comment out
that code but can I generate than value from somewhere?? Do I need
more than the SessionId to make this work. Is this all even possible?
Nov 18 '05 #1
4 2063
Make an initial request to the server, no cookie, to an unsecured page
then the response should contain a Set-Cookie: header that will tell you
what to use.

ASPSESSIONID<STUFF> is for ASP not ASP.NET session management
the <STUFF> bit changes every time the server/site process restarts

"Tim Smith" <ti*******@hotmail.com> wrote in message
news:a7*************************@posting.google.co m...
Hi,

We have an ASP.NET web application which is suffering performance
problems. Since setting up robot scripting interacting with the
browser would take a while I hoped I could open a two-way socket with
IIS and replicate the HTTP session information e.g. starting out with

POST /192.168.1.1/login.aspx HTTP/1.1\r\n
Accept-Language: en-us\r\n
ontent-Type: application/x-www-form-urlencoded\r\n
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET
CLR 1.0.3705)\r\n
Host: 192.168.1.1\r\n
ontent-Length: 68\r\n
Connection: Keep-Alive\r\n
Cache-Control: no-cache\r\n
Cookie: ASPSESSIONIDAAATDTQR=OGEFBLJCPEPCNFHMJGPHBCDJ;
ASP.NET_SessionId=ko3ozjqyqb1lbu454cxrf3ft;\r\n
\r\n__EVENTTARGET=&__EVENTARGUMENT=&usersid=abcde& passwd=12345&test=Login
When I network sniff IE I see the ASPSESSIONIDAAADTQR, without it I
get a security timeout from the server. I could probably comment out
that code but can I generate than value from somewhere?? Do I need
more than the SessionId to make this work. Is this all even possible?

Nov 18 '05 #2
if you do the first GET, asp.net will send the cookie values need for the
rest of the session. to do postback (POST) you will need to send the hidden
__Viewstate field that came from the matching GET.

-- bruce (sqlwork.com)

"Tim Smith" <ti*******@hotmail.com> wrote in message
news:a7*************************@posting.google.co m...
Hi,

We have an ASP.NET web application which is suffering performance
problems. Since setting up robot scripting interacting with the
browser would take a while I hoped I could open a two-way socket with
IIS and replicate the HTTP session information e.g. starting out with

POST /192.168.1.1/login.aspx HTTP/1.1\r\n
Accept-Language: en-us\r\n
ontent-Type: application/x-www-form-urlencoded\r\n
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET
CLR 1.0.3705)\r\n
Host: 192.168.1.1\r\n
ontent-Length: 68\r\n
Connection: Keep-Alive\r\n
Cache-Control: no-cache\r\n
Cookie: ASPSESSIONIDAAATDTQR=OGEFBLJCPEPCNFHMJGPHBCDJ;
ASP.NET_SessionId=ko3ozjqyqb1lbu454cxrf3ft;\r\n
\r\n__EVENTTARGET=&__EVENTARGUMENT=&usersid=abcde& passwd=12345&test=Login
When I network sniff IE I see the ASPSESSIONIDAAADTQR, without it I
get a security timeout from the server. I could probably comment out
that code but can I generate than value from somewhere?? Do I need
more than the SessionId to make this work. Is this all even possible?

Nov 18 '05 #3
Ok, I do an intial request with no cookie info, I get back
Set-Cookie: ASP.NET_SessionId=5zaasakdhaksfg34; path=/

So on my next request, which is a POST of the login username and
password I include the session id variable. The login succeeds and
rerturns more cookies:

Set-Cookie:MyAppp=YF3H0HFFFFKOJF034J439FJ09
Set-Cookie:MyAppp=KSAJDDD7AS6D7A6D7ASTDASTD

So on my next GET request I include
Cookie: ASP.NET-SessionId=5zaasakdhaksfg34;
MyAppp=KSAJDDD7AS6D7A6D7ASTDASTD

The MyAppp seems to come from web.config - possibly related to forms
based authentication?

This is as far as I get - further requests for pages (mimicking my
browser) using the returned ids gives me errors:
HTTP/1.1 403 Forbidden

What could I be missing - what are the 403 errors specific to - lack
of authentication?

"Roger Willcocks" <Ro****@l-space-design.com> wrote in message news:<c1**********@lust.ihug.co.nz>...
Make an initial request to the server, no cookie, to an unsecured page
then the response should contain a Set-Cookie: header that will tell you
what to use.

ASPSESSIONID<STUFF> is for ASP not ASP.NET session management
the <STUFF> bit changes every time the server/site process restarts

"Tim Smith" <ti*******@hotmail.com> wrote in message
news:a7*************************@posting.google.co m...
Hi,

We have an ASP.NET web application which is suffering performance
problems. Since setting up robot scripting interacting with the
browser would take a while I hoped I could open a two-way socket with
IIS and replicate the HTTP session information e.g. starting out with

POST /192.168.1.1/login.aspx HTTP/1.1\r\n
Accept-Language: en-us\r\n
ontent-Type: application/x-www-form-urlencoded\r\n
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET
CLR 1.0.3705)\r\n
Host: 192.168.1.1\r\n
ontent-Length: 68\r\n
Connection: Keep-Alive\r\n
Cache-Control: no-cache\r\n
Cookie: ASPSESSIONIDAAATDTQR=OGEFBLJCPEPCNFHMJGPHBCDJ;
ASP.NET_SessionId=ko3ozjqyqb1lbu454cxrf3ft;\r\n
\r\n__EVENTTARGET=&__EVENTARGUMENT=&usersid=abcde& passwd=12345&test=Login
When I network sniff IE I see the ASPSESSIONIDAAADTQR, without it I
get a security timeout from the server. I could probably comment out
that code but can I generate than value from somewhere?? Do I need
more than the SessionId to make this work. Is this all even possible?

Nov 18 '05 #4
When I use a network sniffer on IE - I do see a couple of fields that
are passed back, but they are empty? Is this passed as
application/x-www-form-urlencoded data? If the web page passes no
extra HTML or HTTP information - what else could be needed? I seem to
matching IE communication with my socket code.

"bruce barker" <no***********@safeco.com> wrote in message news:<Ot**************@TK2MSFTNGP10.phx.gbl>...
if you do the first GET, asp.net will send the cookie values need for the
rest of the session. to do postback (POST) you will need to send the hidden
__Viewstate field that came from the matching GET.

-- bruce (sqlwork.com)

"Tim Smith" <ti*******@hotmail.com> wrote in message
news:a7*************************@posting.google.co m...
Hi,

We have an ASP.NET web application which is suffering performance
problems. Since setting up robot scripting interacting with the
browser would take a while I hoped I could open a two-way socket with
IIS and replicate the HTTP session information e.g. starting out with

POST /192.168.1.1/login.aspx HTTP/1.1\r\n
Accept-Language: en-us\r\n
ontent-Type: application/x-www-form-urlencoded\r\n
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET
CLR 1.0.3705)\r\n
Host: 192.168.1.1\r\n
ontent-Length: 68\r\n
Connection: Keep-Alive\r\n
Cache-Control: no-cache\r\n
Cookie: ASPSESSIONIDAAATDTQR=OGEFBLJCPEPCNFHMJGPHBCDJ;
ASP.NET_SessionId=ko3ozjqyqb1lbu454cxrf3ft;\r\n
\r\n__EVENTTARGET=&__EVENTARGUMENT=&usersid=abcde& passwd=12345&test=Login
When I network sniff IE I see the ASPSESSIONIDAAADTQR, without it I
get a security timeout from the server. I could probably comment out
that code but can I generate than value from somewhere?? Do I need
more than the SessionId to make this work. Is this all even possible?

Nov 18 '05 #5

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

Similar topics

2
by: Lisa Pearlson | last post by:
Hi, My php application (on Apache/Linux) needs to do the following: The PHP script receives a request from a client (binary), asking for certain records of data. My PHP script loops through...
1
by: rawCoder | last post by:
Hi, (NOTE: For the following post, please Only Consider HTTP Via WebBrowser) Data Publishing over HTTP is 'pull' based, i.e. the browser has to request(refresh) to get data. Is there any...
10
by: Mat | last post by:
I would like to write a client-server application which will communicate through HTTP PROTOCOL . essentially, client will send and received xml files. is it possible?? I want to use http...
14
by: Brad Allison | last post by:
Sorry to repeat myself if this is the same question I asked in the past, but I have finally made a connection to our AS400 through ODBC. I tried to get the connection using the data connection...
1
by: Dzemo | last post by:
I need to communicate with lab analyzer using ASTM E1381-91 protocol from my VB.NET application. Any examples code showing that how to do that or any control. I communicate trough RS232 port (I...
4
by: Bob Badger | last post by:
Hi, Simple question (although I guess with a complicated answer). Is HTTP an async protocol? For instance, if I send a message to a c# webservice via http what is the protocol actually doing? ...
1
by: dupe576 | last post by:
Hey, My boss put me in charge of getting this pin pad device to work with our software. We have it plugging into the usb port with a converter cable that converts it to a rs232 port. This...
8
by: rdabane | last post by:
I'm trying to perform following type of operation from inside a python script. 1. Open an application shell (basically a tcl ) 2. Run some commands on that shell and get outputs from each command...
13
by: kryptonite88 | last post by:
I am making a link between 2 systems. They communicate over a serial link. I know the protocol and all the commands. However I can’t figure out what the “dn” is supposed to mean. Is it the number...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.