问题
I need to know How basic types Int, enum, string get stored in session variable. Are they get serialized first before storing.
回答1:
That depends entirely on how session state is configured.
If you just store session state in-memory, serialization is not needed. The variables are stored straight into a dictionary object.
If you store session state on a session state server or in the database, then the variables are indeed serialized and deserialized all the time.
You can find out more at http://msdn.microsoft.com/en-us/magazine/cc163730.aspx.
来源:https://stackoverflow.com/questions/13008804/how-basic-types-get-stored-in-asp-net-session-variable