The Session ID is in a cookie that is sent with the Response. It can be a
bit tricky to get them out. Here's some code from a class I wrote, which
should work for you:
if (Response.Cookies != null && Response.Cookies.Count > 0)
Cookies = Response.Cookies;
else if (Response.Headers["Set-Cookie"] != null)
{
string[] cookie = Text.Split(Response.Headers["Set-Cookie"], ";");
string[] av = Text.Split(cookie[0], "=");
Cookie c = new Cookie(av[0], av[1]);
c.Domain = Response.ResponseUri.Host;
Cookies.Add(c);
}
Cookies is a field that is of the type System.Net.CookieCollection.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Who is Mighty Abbott?
A twin turret scalawag.
"Mike" <my***@pearcey2001.freeserve.co.uk> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Hi,
I've been using httpwebrequest / xmlserverhttp to log into a website
via POST. I've received all the response headers back, some of which
contain the "set-cookie" headers.
When performing any other action on the website I need to submit the
JSESSION id and BSESSIONID as part of my POSTS.
I was just wondering where these session ids originate, from the server
or client side as I cannot see these in the response headers. If its
from the server how do I capture this? If it is client side, how does
one generate them? I assume if it is client side then they must be
being sent with my original log-in POST?
Thank you for any help,
Mike