Sharing Session between webservice and asp.net application

Posted by Alex Mendez on Stack Overflow See other posts from Stack Overflow or by Alex Mendez
Published on 2010-04-23T13:21:41Z Indexed on 2010/04/23 13:23 UTC
Read the original article Hit count: 316

Filed under:
|
|
|
|

I have an asp.net application and webservices (asmx) that reside in the same application but not in the same folder of the aspx files. I aslo have a winform application that uses the webservices. I have marked the webservice methods with [WebMethod(EnableSession = true)] but I am not able to share the same session values that are on the application in the webservices. The winform application has access to the sessionID from the application and I am using the following code

Uri uri = new Uri(ServerServiceUrl);
_cookieContainer = new CookieContainer();
_cookieContainer.Add(new Cookie("ASP.NET_SessionId", SessionID, "/", uri.Host));

My question is: Is there something that I am missing or doing wrong that I cannot access the application sessioin from the webservices?

© Stack Overflow or respective owner

Related posts about c#2.0

Related posts about webservice