There is a problem in InProc Mode of session management- it
clears all the sessions when the worker process re-starts. But this can be
solved easily when the mode is SQL Server. It keeps the sessions away from the
Web Server and solves the above stated issue.
In the case of InProc mode, you can keep anything in
session. This anything includes simple variables to complex objects. But there
are some limitations for SQL Server Session management. You simply cannot dump
the variables into the session that you used to do in InProc mode. In SQL Server
mode the session variables are getting Serialized and then stored in SQL
Server. Similarly, you need to De-Serialize them while retrieving.
From the above point it can be easily understood that, in
SQL Server mode, you cannot store the objects which are not Serializable. To
store complex objects into sessions you have to make them Serialized.
Performance also plays a role here. In InProc mode you can
directly store and retrieve the values, but in SQL Server management it
internally hits the database each time for any session related matters
hindering the performance of the application.
Apart from that, Serialization and DeSerialization is also a
needed requisite for SQL Server session mode.