When putting my application on a web server and trying to \'log in\' I get the following error:
Server Error in \'/\' Application.
Unable to serialize the se
There is another solution, While inheriting a non-serializable class also implment ISerlializable interface GetObjectData method. Inherited class should also be marked as [Serializable].
The regular session is simply stored in memory, but when you are working in a load-balanced environment you cannot rely on the same server handling postbacks why the session must be stored in a shared session mechanism primarily SQL Server and StateServer.
This can be configured in machine.config or somewhere deeper than the app web.config why might not be aware of such a change but it could explain your sudden exception when deploying to the internet.
As mentioned in another answer and in the comments the problem would then arise when the session object is not [Serializable]; while you are working in regular session the object is not serialized but just stored in server memory, but going online introduces different session mechanisms and the need for the objects to be serializable.