How does "Require SSL" affect ASP.NET MVC application lifecycle?
        Posted  
        
            by Ragesh
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Ragesh
        
        
        
        Published on 2010-06-16T17:30:55Z
        Indexed on 
            2010/06/16
            17:32 UTC
        
        
        Read the original article
        Hit count: 436
        
I have an application that taps into BeginRequest and EndRequest to set up and tear down NHibernate sessions like this:
BeginRequest += delegate
{
    CurrentSessionContext.Bind(SessionFactory.OpenSession());
};
EndRequest += delegate
{
    var session = CurrentSessionContext.Unbind(SessionFactory);
    session.Dispose();
    Container.Release(session);
};
This works fine when deployed in IIS, until I check the "Require SSL" box. Once I do this, I get a NullReferenceException at session.Dispose().
I haven't debugged this yet and, yes, the fix is trivial, but I'm just curious about how "Require SSL" affects the lifecycle of a request. Is a session not set up on the server in these cases?
© Stack Overflow or respective owner