A
ALA
Hi,
does anybody know if it is possible to pass the SessionID with a web
request by using a cookie so that the invoked page in the same domain
can access the session objects of the current user?
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.CookieContainer = new CookieContainer();
HttpCookie sessionCookie =
HttpContext.Current.Request.Cookies["ASP.NET_SessionId"];
request.CookieContainer.Add(new Cookie(sessCookie.Name,
sessCookie.Value, "/", "localhost"));
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
This example doesn't seem to work for me but I do not know why... at
least I get a timeout when I execute the code above although the
mechanism works for every other cookie type, too. If I start a
HttpWebRequest without any session information, the target page has a
new and different sessionID than the soure page.
Thanks for the help
Andre
does anybody know if it is possible to pass the SessionID with a web
request by using a cookie so that the invoked page in the same domain
can access the session objects of the current user?
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.CookieContainer = new CookieContainer();
HttpCookie sessionCookie =
HttpContext.Current.Request.Cookies["ASP.NET_SessionId"];
request.CookieContainer.Add(new Cookie(sessCookie.Name,
sessCookie.Value, "/", "localhost"));
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
This example doesn't seem to work for me but I do not know why... at
least I get a timeout when I execute the code above although the
mechanism works for every other cookie type, too. If I start a
HttpWebRequest without any session information, the target page has a
new and different sessionID than the soure page.
Thanks for the help
Andre