user3236289
user3236289

Reputation:

ASP NET Permanent Session IOS APP

I develop ios program and i use asp net session system.The problem is when i close program,session is deleting!how can i handle with this?

Code section: 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;
            }

Upvotes: 1

Views: 528

Answers (1)

user3236289
user3236289

Reputation:

i solved my problem by using cookie thanks! https://www.youtube.com/watch?v=PmziMRE9NQ8

Upvotes: 0

Related Questions