ASP NET永久会话IOS APP

时间:2015-02-21 19:28:22

标签: c# ios asp.net session

我开发ios程序,我使用asp网络会话系统。问题是当我关闭程序时,会话正在删除!我该如何处理?

代码部分:   protected void Page_Load(object sender,EventArgs e)         {             Response.Headers.Add(" Content-type"," text / json");             Response.Headers.Add(" Content-type"," application / json");             string b = Request.QueryString [" routeFunc"];

        if (b != "user/login")
        {
            Dictionary<string, string> userData = (Dictionary<string, string>)Session["userData"];
            if (userData == null)
            {
                userData = new Dictionary<string, string>();
                userData.Add("false", "0");
                echo(JsonConvert.SerializeObject(userData));
                return;
            }
            else
            {
                Session["userData"] = c_mysql.FindOne("users", "id", userData["id"]);
                userData = (Dictionary<string, string>)Session["userData"];
                c_user.userData = userData;
                c_user.notificationCenter.userData2 = userData;
            }

1 个答案:

答案 0 :(得分:0)

我用cookie感谢解决了我的问题! https://www.youtube.com/watch?v=PmziMRE9NQ8