简体   繁体   中英

Session error in wcf service call through ajax

I want to know if sessions are maintained through ajax calls. I have a Sencha(JS) client which makes ajax GET calls to the server.Server side is implemented using WCF C# .Now when I make the first call the session should start and it seems it is starting. but when the application is making the next call which needs the server to retrieve some value from session which it saved in the first call i am getting an error.As the first call where the session is getting set is nt throwing error so I believe session is getting started. But in the 2nd call it is throwing error.

POINT TO BE NOTED : This is only happening when calling through application. If I am calling simply hitting the GET url in browser everything working perfectly.

Please help what could be the reason. I am at a loss.

Sessions are mapped using a session cookie.

You should verify that your application is actually forwarding the session cookie in the call that fails. Enumerate all cookies in the call that works and the call that fails and compare.

Continued:

I usually do ajax via a generic handler (.ashx) I use as a facade that in turn calls any sub systems. In this handler I do parameter conversion and json (de)serialization. Maybe you should go for such an approach and not expose your WCF layer?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM