我有一个自定义OpenAPI类型的变量
OpenAPI api = new OpenAPI(HttpContext.Current.Session["urlv1"].ToString(), new Credentials
{
AppKey = HttpContext.Current.Session["appkey"].ToString(),
AppSecret = HttpContext.Current.Session["appsecret"].ToString(),
UserName = HttpContext.Current.Session["username"].ToString(),
Password = HttpContext.Current.Session["password"].ToString(),
LoginDate = HttpContext.Current.Session["logindate"].ToString(),
AccountNumber = HttpContext.Current.Session["accountnumber"].ToString()
});
我用Seesion 存储这个变量
OpenAPI api = (OpenAPI)HttpContext.Current.Session["api"];
用显示转换给api赋值却为空请问怎么取到session的值