默认WebAPI是不支持Session的,如果你非要用Session,可以在Global.asax.cs文件下重写WebApiApplication类的初始化方法开启:
public override void Init()
{
this.PostAuthenticateRequest += (sender, e) => HttpContext.Current.SetSessionStateBehavior(SessionStateBehavior.Required);
base.Init();
}
WebAPI操作:http://www.cnblogs.com/wk1234/archive/2012/04/28/2468491.html
WebAPI jsonp:http://blog.csdn.net/jamkier/article/details/38370867
WebAPI 2 :http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/action-results
WebAPI2 后台调用:http://www.asp.net/web-api/overview/advanced/calling-a-web-api-from-a-net-client
跨域:
http://www.asp.net/web-api/overview/security/enabling-cross-origin-requests-in-web-api