I want to store my session in SQL Server database and for that I want to use session state mode SQLSERVER, and I have changed my web.config and added the session state attribute:
<sessionState mode="SQLServer" timeout="30" sqlConnectionString="Data Source=server;user id=sa;password=sa;" cookieless="false" />
When I run my application I get this error:
Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode, ASP.NET will serialize the session state objects, and as a result non-serializable objects or MarshalByRef objects are not permitted. The same restriction applies if similar serialization is done by the custom session state store in 'Custom' mode.
Please help me, I am in serious problem. Thanks & Regards.