Saturday, March 24, 2012

Ajax and Session when WebServices called from client site

I have been trying to find a solution for session state and AJAX web service calls. I have a simple page that reports different session id than the web service called from AJAX client site. There are lots of discussions of this topic but no real answers.

Am I lost? Is it that each web service calls from the client site are associated always different session?

How can I limit the web services to be called from client when they don't have session in server?

Or is this something I have to do by using the AJAX authentication services?

What about if webservice needs to access the session state variables how this can be accomplished as they have different session ids?

Regards,

Alexander

A unique session ID and a session object is not associated with a session until a session variable is added to the Session. You should assign to and create at least one session variable like following:

Session["__Dummy"] = "Some Value";

After you do this the session Id will remain constant for the session.


Yes, that was the magic... solved my problem.

Thanks...

No comments:

Post a Comment