HttpWebRequest Sessionhandling

  • Thread starter Thread starter Mark Chardonnens
  • Start date Start date
M

Mark Chardonnens

Hi all,

i use the HttpWebRequest an HttpWebResponse for reciving data from the asp
site locahost/test.asp. If i do this for 10 times i will have 10 new session
(IIS). How can i do this in only 1 session?

httpRequest =
(HttpWebRequest)WebRequest.Create("http://localhost/test.asp");
HttpWebResponse
myHttpWebResponse=(HttpWebResponse)httpRequest.GetResponse();

Thanx a lot!
Mark Chardonnens
 
Well yeah, you'll get a new session, but it should close the last one, so
you shouldn't have 10 simultanous sessions.
 
hmm... whats about session-variables? if i connect the first time on my
site, i have to post some login data. With my second call i'm allowed to get
some data.... if i get there a new session, so i'm not logged in right? how
can do that?

tnx a lot!


Well yeah, you'll get a new session, but it should close the last one, so
you shouldn't have 10 simultanous sessions.
 
Um, I'm not entirely sure what you are trying to do, but if you need to
store data between sessions you can use application variables or
databases, on the server side.

However, if you don't control the server side, ..., not sure. I've used
webrequest/response pretty much only to request a single page or file.
Sorry
 
okey... it works now...

i didnt know that i have to get the cookie and send it back to the server
for next call!
thanks a lot!


Um, I'm not entirely sure what you are trying to do, but if you need to
store data between sessions you can use application variables or
databases, on the server side.

However, if you don't control the server side, ..., not sure. I've used
webrequest/response pretty much only to request a single page or file.
Sorry
 
Back
Top