Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

If I use SessionState mode= Sqlserver; and i declare a session variable for login_button_click event, like

protected void btn_submit_Click(object sender, EventArgs e)
    {
        Session["Username"] = txt_name.Text;
        Response.Redirect("UserDetails.aspx");
    }


-Will the "Username" session be stored in SqlServer's ASPState Database?

and
-Will the Session variable gets Serialized while storing in SQL server automatically?

Kindly suggest friends..
Posted

1 solution

Yes and yes. Using sql should be almost transparent to your code, the Session will work like normal. When it comes to adding objects the object will need to be serialisable, but for native types you don't need to do anything different.

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900