I read that you can store classes directly in a session variable i.e.
Session["var"] = myclass;
My question is how memory management works. Does it automatically serialize this in a client-side session?
Or does it store the data for the class instance in the server’s memory and simply contains the link in the session object?
ASP.Net will store your object in a staticnested dictionary in memory on the server.Then it sends a cookie to the client with the session ID.
static
, , ASP.Net , , , .
( , SQL Server - )
, . , - . SQL Server . .
.
, ASP.NET. , . , , ( ).
, cookie, , -, , , , , .
ASP.NET ,
. , .
, SQL SERVER Database. , , , .
Your default session lasts 20 minutes. You can change this in the web.config file as you wish. But after this time, the Garbage collection will delete it from memory.