views:

195

answers:

1

My Situation:

I have 1 asp.net application with both aspx pages AND webservices

I make calls (using ajax) to the webservice from an aspx page - all within the same asp.net application!

Here is my problem/question Is there any way to share the session state?

I.e. - the aspx page has a sessionID and the state is being maintained. When the call to the webservice is made, is there a way to automatically send the seesionID to the webservice and then be able to access the same session state from the webservice?

--

That would greatly simplify my work! :) Many thanks for your ideas!!

+1  A: 

You should add the EnableSession property to the WebMethod attribute on your web service methods:

[WebMethod(EnableSession=true)]
Jonas H
thanks, i did try that. Still experimenting but the session is not maintained...
Greg Balajewicz
Strange, did you try examining the cookies to verify that the correct session ID is sent?
Jonas H
he he, it did work!! THANKS JONAS!ps, not sure why it did not work before, but i created everything from scratch and it now works. Superb!
Greg Balajewicz